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
3cfec2e2
Kaydet (Commit)
3cfec2e2
authored
May 22, 2015
tarafından
Yury Selivanov
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue 20438: Deprecate inspect.getargspec() and friends.
üst
8d006e75
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
8 deletions
+13
-8
inspect.rst
Doc/library/inspect.rst
+7
-6
inspect.py
Lib/inspect.py
+4
-1
test_inspect.py
Lib/test/test_inspect.py
+2
-1
No files found.
Doc/library/inspect.rst
Dosyayı görüntüle @
3cfec2e2
...
...
@@ -815,15 +815,16 @@ Classes and functions
The first four items in the tuple correspond to :func:`getargspec`.
.. note::
Consider using the new :ref:`Signature Object <inspect-signature-object>`
interface, which provides a better way of introspecting functions.
.. versionchanged:: 3.4
This function is now based on :func:`signature`, but still ignores
``__wrapped__`` attributes and includes the already bound first
parameter in the signature output for bound methods.
.. deprecated:: 3.5
Use :func:`signature` and
:ref:`Signature Object <inspect-signature-object>`, which provide a
better introspecting API for callables.
.. function:: getargvalues(frame)
...
...
@@ -896,8 +897,8 @@ Classes and functions
.. versionadded:: 3.2
..
note::
Consider using the new :meth:`Signature.bind
` instead.
..
deprecated:: 3.5
Use :meth:`Signature.bind` and :meth:`Signature.bind_partial
` instead.
.. function:: getclosurevars(func)
...
...
Lib/inspect.py
Dosyayı görüntüle @
3cfec2e2
...
...
@@ -1033,7 +1033,8 @@ def getargspec(func):
and keyword arguments are supported. getargspec() will raise ValueError
if the func has either annotations or keyword arguments.
"""
warnings
.
warn
(
"inspect.getargspec() is deprecated, "
"use inspect.signature() instead"
,
DeprecationWarning
)
args
,
varargs
,
varkw
,
defaults
,
kwonlyargs
,
kwonlydefaults
,
ann
=
\
getfullargspec
(
func
)
if
kwonlyargs
or
ann
:
...
...
@@ -1057,6 +1058,8 @@ def getfullargspec(func):
'annotations' is a dictionary mapping argument names to annotations.
The first four items in the tuple correspond to getargspec().
This function is deprecated, use inspect.signature() instead.
"""
try
:
...
...
Lib/test/test_inspect.py
Dosyayı görüntüle @
3cfec2e2
...
...
@@ -631,7 +631,8 @@ class TestClassesAndFunctions(unittest.TestCase):
def
assertArgSpecEquals
(
self
,
routine
,
args_e
,
varargs_e
=
None
,
varkw_e
=
None
,
defaults_e
=
None
,
formatted
=
None
):
args
,
varargs
,
varkw
,
defaults
=
inspect
.
getargspec
(
routine
)
with
self
.
assertWarns
(
DeprecationWarning
):
args
,
varargs
,
varkw
,
defaults
=
inspect
.
getargspec
(
routine
)
self
.
assertEqual
(
args
,
args_e
)
self
.
assertEqual
(
varargs
,
varargs_e
)
self
.
assertEqual
(
varkw
,
varkw_e
)
...
...
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