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
2a1fdc4c
Kaydet (Commit)
2a1fdc4c
authored
Nis 17, 2012
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
merge 3.2 (#14607)
üst
64befe93
32c59b6f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletion
+13
-1
test_keywordonlyarg.py
Lib/test/test_keywordonlyarg.py
+6
-0
NEWS
Misc/NEWS
+2
-0
compile.c
Python/compile.c
+5
-1
No files found.
Lib/test/test_keywordonlyarg.py
Dosyayı görüntüle @
2a1fdc4c
...
@@ -170,6 +170,12 @@ class KeywordOnlyArgTestCase(unittest.TestCase):
...
@@ -170,6 +170,12 @@ class KeywordOnlyArgTestCase(unittest.TestCase):
# used to fail with a SystemError.
# used to fail with a SystemError.
lambda
*
,
k1
=
unittest
:
None
lambda
*
,
k1
=
unittest
:
None
def
test_mangling
(
self
):
class
X
:
def
f
(
self
,
*
,
__a
=
42
):
return
__a
self
.
assertEqual
(
X
()
.
f
(),
42
)
def
test_main
():
def
test_main
():
run_unittest
(
KeywordOnlyArgTestCase
)
run_unittest
(
KeywordOnlyArgTestCase
)
...
...
Misc/NEWS
Dosyayı görüntüle @
2a1fdc4c
...
@@ -13,6 +13,8 @@ Core and Builtins
...
@@ -13,6 +13,8 @@ Core and Builtins
- Issue #14592: Attempting a relative import w/o __package__ or __name__ set in
- Issue #14592: Attempting a relative import w/o __package__ or __name__ set in
globals raises a KeyError.
globals raises a KeyError.
- Issue #14607: Fix defaults keyword-only arguments which started with ``__``.
- Issue #10854: The ImportError raised when an extension module on Windows
- Issue #10854: The ImportError raised when an extension module on Windows
fails to import now uses the new path and name attributes from
fails to import now uses the new path and name attributes from
Issue #1559549.
Issue #1559549.
...
...
Python/compile.c
Dosyayı görüntüle @
2a1fdc4c
...
@@ -1409,7 +1409,11 @@ compiler_visit_kwonlydefaults(struct compiler *c, asdl_seq *kwonlyargs,
...
@@ -1409,7 +1409,11 @@ compiler_visit_kwonlydefaults(struct compiler *c, asdl_seq *kwonlyargs,
arg_ty
arg
=
asdl_seq_GET
(
kwonlyargs
,
i
);
arg_ty
arg
=
asdl_seq_GET
(
kwonlyargs
,
i
);
expr_ty
default_
=
asdl_seq_GET
(
kw_defaults
,
i
);
expr_ty
default_
=
asdl_seq_GET
(
kw_defaults
,
i
);
if
(
default_
)
{
if
(
default_
)
{
ADDOP_O
(
c
,
LOAD_CONST
,
arg
->
arg
,
consts
);
PyObject
*
mangled
=
_Py_Mangle
(
c
->
u
->
u_private
,
arg
->
arg
);
if
(
!
mangled
)
return
-
1
;
ADDOP_O
(
c
,
LOAD_CONST
,
mangled
,
consts
);
Py_DECREF
(
mangled
);
if
(
!
compiler_visit_expr
(
c
,
default_
))
{
if
(
!
compiler_visit_expr
(
c
,
default_
))
{
return
-
1
;
return
-
1
;
}
}
...
...
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