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
e24ee8f9
Kaydet (Commit)
e24ee8f9
authored
May 15, 2019
tarafından
Batuhan Taşkaya
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Handle := in ast_unparse.c
üst
5eb8b07f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
0 deletions
+16
-0
test_future.py
Lib/test/test_future.py
+2
-0
2019-05-15-14-01-09.bpo-36826.GLrO3W.rst
...ore and Builtins/2019-05-15-14-01-09.bpo-36826.GLrO3W.rst
+1
-0
ast_unparse.c
Python/ast_unparse.c
+13
-0
No files found.
Lib/test/test_future.py
Dosyayı görüntüle @
e24ee8f9
...
@@ -275,6 +275,8 @@ class AnnotationsFutureTestCase(unittest.TestCase):
...
@@ -275,6 +275,8 @@ class AnnotationsFutureTestCase(unittest.TestCase):
eq
(
'f((x for x in a), 2)'
)
eq
(
'f((x for x in a), 2)'
)
eq
(
'(((a)))'
,
'a'
)
eq
(
'(((a)))'
,
'a'
)
eq
(
'(((a, b)))'
,
'(a, b)'
)
eq
(
'(((a, b)))'
,
'(a, b)'
)
eq
(
"(x:=10)"
)
eq
(
"f'{(x:=10):=10}'"
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
...
...
Misc/NEWS.d/next/Core and Builtins/2019-05-15-14-01-09.bpo-36826.GLrO3W.rst
0 → 100644
Dosyayı görüntüle @
e24ee8f9
Add NamedExpression kind support to ast_unparse.c
Python/ast_unparse.c
Dosyayı görüntüle @
e24ee8f9
...
@@ -809,6 +809,17 @@ append_ast_await(_PyUnicodeWriter *writer, expr_ty e, int level)
...
@@ -809,6 +809,17 @@ append_ast_await(_PyUnicodeWriter *writer, expr_ty e, int level)
return
0
;
return
0
;
}
}
static
int
append_named_expr
(
_PyUnicodeWriter
*
writer
,
expr_ty
e
,
int
level
)
{
APPEND_STR_IF
(
level
>
PR_TUPLE
,
"("
);
APPEND_EXPR
(
e
->
v
.
NamedExpr
.
target
,
PR_ATOM
);
APPEND_STR
(
":="
);
APPEND_EXPR
(
e
->
v
.
NamedExpr
.
value
,
PR_ATOM
);
APPEND_STR_IF
(
level
>
PR_TUPLE
,
")"
);
return
0
;
}
static
int
static
int
append_ast_expr
(
_PyUnicodeWriter
*
writer
,
expr_ty
e
,
int
level
)
append_ast_expr
(
_PyUnicodeWriter
*
writer
,
expr_ty
e
,
int
level
)
{
{
...
@@ -867,6 +878,8 @@ append_ast_expr(_PyUnicodeWriter *writer, expr_ty e, int level)
...
@@ -867,6 +878,8 @@ append_ast_expr(_PyUnicodeWriter *writer, expr_ty e, int level)
return
append_ast_list
(
writer
,
e
);
return
append_ast_list
(
writer
,
e
);
case
Tuple_kind
:
case
Tuple_kind
:
return
append_ast_tuple
(
writer
,
e
,
level
);
return
append_ast_tuple
(
writer
,
e
,
level
);
case
NamedExpr_kind
:
return
append_named_expr
(
writer
,
e
,
level
);
default:
default:
PyErr_SetString
(
PyExc_SystemError
,
PyErr_SetString
(
PyExc_SystemError
,
"unknown expression kind"
);
"unknown expression kind"
);
...
...
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