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
a5a5728c
Kaydet (Commit)
a5a5728c
authored
Haz 08, 2009
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
remove error checks already done in set_context()
üst
8ea4ded9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
30 deletions
+5
-30
test_generators.py
Lib/test/test_generators.py
+1
-1
test_genexps.py
Lib/test/test_genexps.py
+1
-1
test_syntax.py
Lib/test/test_syntax.py
+3
-3
ast.c
Python/ast.c
+0
-25
No files found.
Lib/test/test_generators.py
Dosyayı görüntüle @
a5a5728c
...
...
@@ -1588,7 +1588,7 @@ SyntaxError: can't assign to yield expression
Traceback (most recent call last):
...
File "<doctest test.test_generators.__test__.coroutine[25]>", line 1
SyntaxError:
augmented assignment to yield expression not possible
SyntaxError:
can't assign to yield expression
Now check some throw() conditions:
...
...
Lib/test/test_genexps.py
Dosyayı görüntüle @
a5a5728c
...
...
@@ -144,7 +144,7 @@ Verify that syntax error's are raised for genexps used as lvalues
Traceback (most recent call last):
...
File "<doctest test.test_genexps.__test__.doctests[41]>", line 1
SyntaxError:
augmented assignment to generator expression not possible
SyntaxError:
can't assign to generator expression
########### Tests borrowed from or inspired by test_generators.py ############
...
...
Lib/test/test_syntax.py
Dosyayı görüntüle @
a5a5728c
...
...
@@ -248,12 +248,12 @@ Traceback (most recent call last):
SyntaxError: keyword can't be an expression
From ast_for_expr_stm
t():
More set_contex
t():
>>> (x for x in x) += 1
Traceback (most recent call last):
File "<doctest test.test_syntax[31]>", line 1
SyntaxError:
augmented assignment to generator expression not possible
SyntaxError:
can't assign to generator expression
>>> None += 1
Traceback (most recent call last):
File "<doctest test.test_syntax[32]>", line 1
...
...
@@ -261,7 +261,7 @@ SyntaxError: cannot assign to None
>>> f() += 1
Traceback (most recent call last):
File "<doctest test.test_syntax[33]>", line 1
SyntaxError:
illegal expression for augmented assignment
SyntaxError:
can't assign to function call
Test continue in finally in weird combinations.
...
...
Python/ast.c
Dosyayı görüntüle @
a5a5728c
...
...
@@ -2088,31 +2088,6 @@ ast_for_expr_stmt(struct compiling *c, const node *n)
expr1
=
ast_for_testlist
(
c
,
ch
);
if
(
!
expr1
)
return
NULL
;
/* TODO(nas): Remove duplicated error checks (set_context does it) */
switch
(
expr1
->
kind
)
{
case
GeneratorExp_kind
:
ast_error
(
ch
,
"augmented assignment to generator "
"expression not possible"
);
return
NULL
;
case
Yield_kind
:
ast_error
(
ch
,
"augmented assignment to yield "
"expression not possible"
);
return
NULL
;
case
Name_kind
:
{
const
char
*
var_name
=
PyBytes_AS_STRING
(
expr1
->
v
.
Name
.
id
);
if
((
var_name
[
0
]
==
'N'
||
var_name
[
0
]
==
'T'
||
var_name
[
0
]
==
'F'
)
&&
!
forbidden_check
(
c
,
ch
,
var_name
))
return
NULL
;
break
;
}
case
Attribute_kind
:
case
Subscript_kind
:
break
;
default:
ast_error
(
ch
,
"illegal expression for augmented "
"assignment"
);
return
NULL
;
}
if
(
!
set_context
(
c
,
expr1
,
Store
,
ch
))
return
NULL
;
...
...
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