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
9953a8df
Kaydet (Commit)
9953a8df
authored
Ock 17, 2009
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fix inspect.formatargspec on functions with keyword-only arguments without defaults #4959
üst
c10c34d6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
1 deletion
+15
-1
inspect.py
Lib/inspect.py
+1
-1
inspect_fodder2.py
Lib/test/inspect_fodder2.py
+4
-0
test_inspect.py
Lib/test/test_inspect.py
+7
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/inspect.py
Dosyayı görüntüle @
9953a8df
...
...
@@ -894,7 +894,7 @@ def formatargspec(args, varargs=None, varkw=None, defaults=None,
if
kwonlyargs
:
for
kwonlyarg
in
kwonlyargs
:
spec
=
formatargandannotation
(
kwonlyarg
)
if
kwonlyarg
in
kwonlydefaults
:
if
kwonly
defaults
and
kwonly
arg
in
kwonlydefaults
:
spec
+=
formatvalue
(
kwonlydefaults
[
kwonlyarg
])
specs
.
append
(
spec
)
if
varkw
is
not
None
:
...
...
Lib/test/inspect_fodder2.py
Dosyayı görüntüle @
9953a8df
...
...
@@ -105,3 +105,7 @@ def keyworded(*arg1, arg2=1):
#line 105
def
annotated
(
arg1
:
list
):
pass
#line 109
def
keyword_only_arg
(
*
,
arg
):
pass
Lib/test/test_inspect.py
Dosyayı görüntüle @
9953a8df
...
...
@@ -386,6 +386,9 @@ class TestClassesAndFunctions(unittest.TestCase):
self
.
assertRaises
(
ValueError
,
self
.
assertArgSpecEquals
,
mod2
.
annotated
,
[])
self
.
assertRaises
(
ValueError
,
self
.
assertArgSpecEquals
,
mod2
.
keyword_only_arg
,
[])
def
test_getfullargspec
(
self
):
self
.
assertFullArgSpecEquals
(
mod2
.
keyworded
,
[],
varargs_e
=
'arg1'
,
...
...
@@ -396,6 +399,10 @@ class TestClassesAndFunctions(unittest.TestCase):
self
.
assertFullArgSpecEquals
(
mod2
.
annotated
,
[
'arg1'
],
ann_e
=
{
'arg1'
:
list
},
formatted
=
'(arg1: list)'
)
self
.
assertFullArgSpecEquals
(
mod2
.
keyword_only_arg
,
[],
kwonlyargs_e
=
[
'arg'
],
formatted
=
'(*, arg)'
)
def
test_getargspec_method
(
self
):
class
A
(
object
):
...
...
Misc/NEWS
Dosyayı görüntüle @
9953a8df
...
...
@@ -126,6 +126,9 @@ Core and Builtins
Library
-------
- Issue #4959: inspect.formatargspec now works for keyword only arguments
without defaults.
- Issue #3826 and #4791: The socket module now closes the underlying socket
appropriately when it is being used via socket.makefile() objects
rather than delaying the close by waiting for garbage collection to do it.
...
...
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