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
6496788e
Kaydet (Commit)
6496788e
authored
Haz 27, 2003
tarafından
Jeremy Hylton
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix for SF bug 620190: getargspec() doesn't work with methods.
üst
7ff55e6b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
inspect.py
Lib/inspect.py
+10
-3
No files found.
Lib/inspect.py
Dosyayı görüntüle @
6496788e
...
...
@@ -593,7 +593,9 @@ def getargs(co):
Three things are returned: (args, varargs, varkw), where 'args' is
a list of argument names (possibly containing nested lists), and
'varargs' and 'varkw' are the names of the * and ** arguments or None."""
if
not
iscode
(
co
):
raise
TypeError
,
'arg is not a code object'
if
not
iscode
(
co
):
raise
TypeError
(
'arg is not a code object'
)
code
=
co
.
co_code
nargs
=
co
.
co_argcount
...
...
@@ -642,8 +644,13 @@ def getargspec(func):
A tuple of four things is returned: (args, varargs, varkw, defaults).
'args' is a list of the argument names (it may contain nested lists).
'varargs' and 'varkw' are the names of the * and ** arguments or None.
'defaults' is an n-tuple of the default values of the last n arguments."""
if
not
isfunction
(
func
):
raise
TypeError
,
'arg is not a Python function'
'defaults' is an n-tuple of the default values of the last n arguments.
"""
if
ismethod
(
func
):
func
=
func
.
im_func
if
not
isfunction
(
func
):
raise
TypeError
(
'arg is not a Python function'
)
args
,
varargs
,
varkw
=
getargs
(
func
.
func_code
)
return
args
,
varargs
,
varkw
,
func
.
func_defaults
...
...
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