Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
4afbba3d
Kaydet (Commit)
4afbba3d
authored
Haz 13, 2009
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
keep the slice.step field as NULL if no step expression is given
üst
cb73bdac
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
8 deletions
+10
-8
test_ast.py
Lib/test/test_ast.py
+6
-0
NEWS
Misc/NEWS
+3
-0
ast.c
Python/ast.c
+1
-8
No files found.
Lib/test/test_ast.py
Dosyayı görüntüle @
4afbba3d
...
...
@@ -146,6 +146,12 @@ class AST_Tests(unittest.TestCase):
self
.
assertEquals
(
to_tuple
(
ast_tree
),
o
)
self
.
_assert_order
(
ast_tree
,
(
0
,
0
))
def
test_slice
(
self
):
slc
=
ast
.
parse
(
"x[::]"
)
.
body
[
0
]
.
value
.
slice
self
.
assertIsNone
(
slc
.
upper
)
self
.
assertIsNone
(
slc
.
lower
)
self
.
assertIsNone
(
slc
.
step
)
def
test_nodeclasses
(
self
):
x
=
ast
.
BinOp
(
1
,
2
,
3
,
lineno
=
0
)
self
.
assertEquals
(
x
.
left
,
1
)
...
...
Misc/NEWS
Dosyayı görüntüle @
4afbba3d
...
...
@@ -12,6 +12,9 @@ What's New in Python 2.7 alpha 1
Core and Builtins
-----------------
- In the slice AST type, the step field will always be None if a step expression
is not specified.
- Issue #4547: When debugging a very large function, it was not always
possible to update the lineno attribute of the current frame.
...
...
Python/ast.c
Dosyayı görüntüle @
4afbba3d
...
...
@@ -1468,14 +1468,7 @@ ast_for_slice(struct compiling *c, const node *n)
ch
=
CHILD
(
n
,
NCH
(
n
)
-
1
);
if
(
TYPE
(
ch
)
==
sliceop
)
{
if
(
NCH
(
ch
)
==
1
)
{
/* No expression, so step is None */
ch
=
CHILD
(
ch
,
0
);
step
=
Name
(
new_identifier
(
"None"
,
c
->
c_arena
),
Load
,
LINENO
(
ch
),
ch
->
n_col_offset
,
c
->
c_arena
);
if
(
!
step
)
return
NULL
;
}
else
{
if
(
NCH
(
ch
)
!=
1
)
{
ch
=
CHILD
(
ch
,
1
);
if
(
TYPE
(
ch
)
==
test
)
{
step
=
ast_for_expr
(
c
,
ch
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment