Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-45320 Remove deprecated inspect methods #28618

Merged
merged 1 commit into from
Oct 20, 2021

Conversation

hugovk
Copy link
Member

@hugovk hugovk commented Sep 29, 2021

These can be removed in Python 3.11.

https://bugs.python.org/issue45320

@ambv
Copy link
Contributor

ambv commented Sep 29, 2021

Before we proceed with this, let's ensure we know more about whether the deprecated callable are dropped by the community.

@hugovk
Copy link
Member Author

hugovk commented Sep 29, 2021

Of the 188 repos I managed to clone of 200 top PyPI packages, 19 have any match for:

ag "\bgetargspec\b|\bformatargspec\b|\bfrom_callable\b|\bfrom_function\b"

  1. backcall
  2. beam
  3. botocore
  4. client_python
  5. cython
  6. decorator
  7. google-api-python-client
  8. grpc
  9. ipython
  10. joblib
  11. mako
  12. matplotlib
  13. pluggy
  14. pycodestyle
  15. pyrsistent
  16. python-prompt-toolkit
  17. traitlets
  18. werkzeug
  19. wrapt
Details
pycodestyle/pycodestyle.py
186:        return inspect.getargspec(function)[0]

backcall/backcall/_signatures.py
97:        return Signature.from_function(obj)
514:    def from_function(cls, func):

pyrsistent/pyrsistent/_field_common.py
69:        return 'ignore_extra' in inspect.getargspec(field.factory).args

pyrsistent/tests/memory_profiling.py
40:        fn_args = inspect.getargspec(fn)[0]

mako/mako/compat.py
24:    """getargspec based on fully vendored getfullargspec from Python 3.3."""

mako/mako/ext/turbogears.py
33:        # in getargspec

mako/doc/build/changelog.rst
356:      additionally replace the use of ``inspect.getargspec()`` under

decorator/CHANGES.md
86:`decorator.getargspec` and provided `decorator.getfullargspec`
171:Removed any dependence from `inspect.getargspec`, which is deprecated

grpc/src/python/grpcio/grpc/_auth.py
33:        self._is_jwt = 'additional_claims' in inspect.getargspec(  # pylint: disable=deprecated-method

ipython/IPython/core/oinspect.py
200:def getargspec(obj):
209:    warnings.warn('`getargspec` function is deprecated as of IPython 7.10'
231:    return inspect.formatargspec(argspec['args'], argspec['varargs'],

ipython/IPython/testing/tests/test_decorators.py
20:def getargspec(obj):
28:    Modified version of inspect.getargspec from the Python Standard
148:    dtargsr = getargspec(doctest_bad)

python-prompt-toolkit/CHANGELOG
680:  * Added the `Validator.from_callable` class method for easy creation of
1084:- Don't use deprecated inspect.getargspec on Python 3.

python-prompt-toolkit/docs/pages/asking_for_input.rst
486:use the :meth:`~prompt_toolkit.validation.Validator.from_callable` classmethod.
498:    validator = Validator.from_callable(
508::meth:`~prompt_toolkit.validation.Validator.from_callable` turns that into a

python-prompt-toolkit/prompt_toolkit/validation.py
51:    - Or by passing a callable to `Validator.from_callable`.
79:    def from_callable(
92:            Validator.from_callable(is_valid, error_message='Invalid input')
117:        return "Validator.from_callable(%r)" % (self.func,)

python-prompt-toolkit/examples/prompts/input-validation.py
13:validator = Validator.from_callable(

client_python/tests/test_core.py
15:from prometheus_client.decorator import getargspec
64:        self.assertEqual((["r"], None, None, None), getargspec(f))
143:        self.assertEqual(([], None, None, None), getargspec(f))
175:        self.assertEqual(([], None, None, None), getargspec(f))
242:        self.assertEqual(([], None, None, None), getargspec(f))
384:        self.assertEqual(([], None, None, None), getargspec(f))

client_python/prometheus_client/decorator.py
57:                inspect.getargspec(f)
67:        getargspec = inspect.getargspec
73:# getargspec has been deprecated in Python 3.5
78:def getargspec(f):
79:    """A replacement for inspect.getargspec"""
118:                        inspect.formatargspec(

werkzeug/CHANGES.rst
888:  `inspect.getargspec` is gone in 3.6

cython/tests/run/py34_signature.pyx
8:    sig = inspect.Signature.from_callable
10:    sig = inspect.Signature.from_function

cython/Cython/Utility/CythonFunction.c
450://    // return Signature.from_function(op)
451://    signature = PyObject_CallMethodObjArgs(signature_class, PYIDENT("from_function"), op, NULL);

wrapt/tests/test_outer_classmethod.py
99:        original_argspec = inspect.getargspec(Original.function)
100:        function_argspec = inspect.getargspec(Class.function)
106:        original_argspec = inspect.getargspec(Original().function)
107:        function_argspec = inspect.getargspec(Class().function)

wrapt/tests/test_inner_classmethod.py
98:        original_argspec = inspect.getargspec(Original.function)
99:        function_argspec = inspect.getargspec(Class.function)
105:        original_argspec = inspect.getargspec(Original().function)
106:        function_argspec = inspect.getargspec(Class().function)

wrapt/tests/test_inner_staticmethod.py
98:        original_argspec = inspect.getargspec(Original.function)
99:        function_argspec = inspect.getargspec(Class.function)
105:        original_argspec = inspect.getargspec(Original().function)
106:        function_argspec = inspect.getargspec(Class().function)

wrapt/tests/test_adapter.py
75:        function1a_argspec = inspect.getargspec(_adapter)
76:        function1d_argspec = inspect.getargspec(function1d)
83:        bound_function1d_argspec = inspect.getargspec(bound_function1d)
110:        argspec = inspect.getargspec(_adapter)
120:        self.assertEqual(inspect.getargspec(_function_1), argspec)
122:        args = inspect.formatargspec(*argspec)
132:        self.assertEqual(inspect.getargspec(_function_2), argspec)
137:        argspec = inspect.getargspec(_adapter)
150:        self.assertEqual(inspect.getargspec(Class1.function), argspec)
151:        self.assertEqual(inspect.getargspec(instance1.function), argspec)
153:        args = inspect.formatargspec(*argspec)
166:        self.assertEqual(inspect.getargspec(Class2.function), argspec)
167:        self.assertEqual(inspect.getargspec(instance2.function), argspec)
172:        argspec = inspect.getargspec(_adapter)
186:        self.assertEqual(inspect.getargspec(Class1.function), argspec)
187:        self.assertEqual(inspect.getargspec(instance1.function), argspec)
189:        args = inspect.formatargspec(*argspec)
203:        self.assertEqual(inspect.getargspec(Class2.function), argspec)
204:        self.assertEqual(inspect.getargspec(instance2.function), argspec)
208:            argspec = inspect.getargspec(wrapped)
220:        argspec = inspect.getargspec(_function_1)

wrapt/tests/test_outer_staticmethod.py
98:        original_argspec = inspect.getargspec(Original.function)
99:        function_argspec = inspect.getargspec(Class.function)
105:        original_argspec = inspect.getargspec(Original().function)
106:        function_argspec = inspect.getargspec(Class().function)

wrapt/tests/test_function.py
60:        function1o_argspec = inspect.getargspec(function1o)
61:        function1d_argspec = inspect.getargspec(function1d)

wrapt/tests/test_adapter_py3.py
131:        args = inspect.formatargspec(*argspec2)
169:        args = inspect.formatargspec(*argspec2)
212:        args = inspect.formatargspec(*argspec2)

wrapt/tests/test_instancemethod.py
98:        original_argspec = inspect.getargspec(OldClass1o.function)
99:        function_argspec = inspect.getargspec(OldClass1d.function)
105:        original_argspec = inspect.getargspec(OldClass1o().function)
106:        function_argspec = inspect.getargspec(OldClass1d().function)
201:        original_argspec = inspect.getargspec(NewClass1o.function)
202:        function_argspec = inspect.getargspec(NewClass1d.function)
208:        original_argspec = inspect.getargspec(NewClass1o().function)
209:        function_argspec = inspect.getargspec(NewClass1d().function)

wrapt/tests/test_nested_function.py
69:        function1o_argspec = inspect.getargspec(function1o())
70:        function1d_argspec = inspect.getargspec(function1d())

wrapt/docs/decorators.rst
349:``getargspec()`` function from the ``inspect`` module can be used.
361:    >>> print(inspect.getargspec(function))
432:When using ``inspect.getargspec()`` the argument specification for the
482:is returned by ``inspect.getargspec()`` or ``inspect.getfullargspec()``,
483:or a string of the form which is returned by ``inspect.formatargspec()``.

wrapt/docs/changes.rst
192:* Code for ``inspect.getargspec()`` when using Python 2.6 was missing
200:* Ensure that ``inspect.getargspec()`` is only used with Python 2.6 where
314:  is returned by ``inspect.getargspec()``, or a string of the form which
315:  is returned by ``inspect.formatargspec()``. In these two cases the
323:          argspec = inspect.getargspec(wrapped)
352:          argspec = inspect.getargspec(wrapped)
655:* Using inspect.getargspec() now works correctly on bound methods when an

wrapt/blog/02-the-interaction-between-decorators-and-descriptors.md
313:`inspect.getargspec()` and `inspect.getsource()` will now work and

wrapt/blog/01-how-you-implemented-your-python-decorator-is-wrong.md
289:>>> print(inspect.getargspec(function))
306:>>> print(inspect.getargspec(function))
309:    print(inspect.getargspec(function))
310:  File ".../inspect.py", line 813, in getargspec

wrapt/src/wrapt/decorators.py
34:from inspect import ismethod, isclass, formatargspec
48:# functions such as inspect.getargspec(), inspect.getfullargspec(),
226:                        adapter = formatargspec(*adapter)

botocore/botocore/compat.py
72:        # changes when using getargspec with functools.partials.
132:        return inspect.getargspec(func)[2]

botocore/botocore/docs/method.py
100:    signature_params = inspect.formatargspec(

joblib/joblib/func_inspect.py
333:    # XXX: Should this use inspect.formatargvalues/formatargspec?

pluggy/CHANGELOG.rst
392:- avoid using deprecated-in-python3.5 getargspec method. Thanks

matplotlib/tools/boilerplate.py
87:    Format function default values as needed for inspect.formatargspec.

beam/sdks/python/apache_beam/transforms/ptransform.py
375:    fn_type_hints = IOTypeHints.from_callable(self.expand)

beam/sdks/python/apache_beam/transforms/core.py
565:  def from_callable(fn):
667:    fn_type_hints = typehints.decorators.IOTypeHints.from_callable(self.process)
752:    fn_type_hints = typehints.decorators.IOTypeHints.from_callable(self._fn)
949:  def from_callable(fn):
1573:      typehints.decorators.IOTypeHints.from_callable(fn))
1770:  fn_type_hints = typehints.decorators.IOTypeHints.from_callable(fn)

beam/sdks/python/apache_beam/transforms/trigger.py
118:      combine_fn = core.CombineFn.from_callable(combine_fn)

beam/sdks/python/apache_beam/typehints/decorators_test.py
68:    th = decorators.IOTypeHints.from_callable(fn)
72:    th = decorators.IOTypeHints.from_callable(len)
76:    # from_callable() injects an annotation in this special type of builtin.
77:    th = decorators.IOTypeHints.from_callable(str.strip)
170:    th = decorators.IOTypeHints.from_callable(fn)
181:    th = decorators.IOTypeHints.from_callable(fn)
194:    th = decorators.IOTypeHints.from_callable(Class)
203:    th = decorators.IOTypeHints.from_callable(Class.method)
207:    th = decorators.IOTypeHints.from_callable(Class().method)
220:    th = decorators.IOTypeHints.from_callable(fn)
234:    th = decorators.IOTypeHints.from_callable(fn)

beam/sdks/python/apache_beam/typehints/decorators.py
239:  def from_callable(cls, fn):
285:    msg = ['from_callable(%s)' % name, '  signature: %s' % signature]

beam/CHANGES.md
371:* Non-idempotent combiners built via `CombineFn.from_callable()` or `CombineFn.maybe_from_callable()` can lead to incorrect behavior. ([BEAM-11522](https://issues.apache.org/jira/browse/BEAM-11522)).

google-api-python-client/googleapiclient/_helpers.py
138:        args, _, _, defaults = inspect.getargspec(max_positional_args)

google-api-python-client/docs/epy/googleapiclient._helpers-pysrc.html
201:<a name="L141"></a><tt class="py-lineno">141</tt>  <tt class="py-line">        <tt class="py-name">args</tt><tt class="py-op">,</tt> <tt class="py-name">_</tt><tt class="py-op">,</tt> <tt class="py-name">_</tt><tt class="py-op">,</tt> <tt class="py-name">defaults</tt> <tt class="py-op">=</tt> <tt class="py-name">inspect</tt><tt class="py-op">.</tt><tt class="py-name">getargspec</tt><tt class="py-op">(</tt><tt class="py-name">max_positional_args</tt><tt class="py-op">)</tt> </tt>

traitlets/docs/source/changelog.rst
269:        - traitlets.utils.getargspec.PY3

traitlets/traitlets/utils/getargspec.py
2:    getargspec excerpted from:
17:def getargspec(func):
18:    """Like inspect.getargspec but supports functools.partial as well."""
23:        argspec = getargspec(orig_func)

traitlets/traitlets/traitlets.py
52:from .utils.getargspec import getargspec
751:        self.nargs = len(getargspec(cb)[0]) + offset

17 ~15 have references to the relevant four methods (actual calls, or vendored versions, or versions based on them, or changelog about removing them):

  1. botocore
  2. client_python
  3. cython
  4. decorator
  5. google-api-python-client
  6. grpc
  7. ipython
  8. joblib
  9. mako
  10. matplotlib
  11. pluggy
  12. pycodestyle
  13. pyrsistent
  14. python-prompt-toolkit
  15. traitlets
  16. werkzeug
  17. wrapt
Details
pycodestyle/pycodestyle.py
186:        return inspect.getargspec(function)[0]

pyrsistent/pyrsistent/_field_common.py
69:        return 'ignore_extra' in inspect.getargspec(field.factory).args

pyrsistent/tests/memory_profiling.py
40:        fn_args = inspect.getargspec(fn)[0]

mako/mako/compat.py
24:    """getargspec based on fully vendored getfullargspec from Python 3.3."""

mako/doc/build/changelog.rst
356:      additionally replace the use of ``inspect.getargspec()`` under

decorator/CHANGES.md
86:`decorator.getargspec` and provided `decorator.getfullargspec`
171:Removed any dependence from `inspect.getargspec`, which is deprecated

grpc/src/python/grpcio/grpc/_auth.py
33:        self._is_jwt = 'additional_claims' in inspect.getargspec(  # pylint: disable=deprecated-method

ipython/IPython/core/oinspect.py
200:def getargspec(obj):
209:    warnings.warn('`getargspec` function is deprecated as of IPython 7.10'
231:    return inspect.formatargspec(argspec['args'], argspec['varargs'],

ipython/IPython/testing/tests/test_decorators.py
20:def getargspec(obj):
28:    Modified version of inspect.getargspec from the Python Standard
148:    dtargsr = getargspec(doctest_bad)

python-prompt-toolkit/CHANGELOG
680:  * Added the `Validator.from_callable` class method for easy creation of
1084:- Don't use deprecated inspect.getargspec on Python 3.

client_python/prometheus_client/decorator.py
57:                inspect.getargspec(f)
67:        getargspec = inspect.getargspec
73:# getargspec has been deprecated in Python 3.5
78:def getargspec(f):
79:    """A replacement for inspect.getargspec"""
118:                        inspect.formatargspec(

werkzeug/CHANGES.rst
888:  `inspect.getargspec` is gone in 3.6

cython/tests/run/py34_signature.pyx
8:    sig = inspect.Signature.from_callable
10:    sig = inspect.Signature.from_function

cython/Cython/Utility/CythonFunction.c
450://    // return Signature.from_function(op)
451://    signature = PyObject_CallMethodObjArgs(signature_class, PYIDENT("from_function"), op, NULL);

wrapt/tests/test_outer_classmethod.py
99:        original_argspec = inspect.getargspec(Original.function)
100:        function_argspec = inspect.getargspec(Class.function)
106:        original_argspec = inspect.getargspec(Original().function)
107:        function_argspec = inspect.getargspec(Class().function)

wrapt/tests/test_inner_classmethod.py
98:        original_argspec = inspect.getargspec(Original.function)
99:        function_argspec = inspect.getargspec(Class.function)
105:        original_argspec = inspect.getargspec(Original().function)
106:        function_argspec = inspect.getargspec(Class().function)

wrapt/tests/test_inner_staticmethod.py
98:        original_argspec = inspect.getargspec(Original.function)
99:        function_argspec = inspect.getargspec(Class.function)
105:        original_argspec = inspect.getargspec(Original().function)
106:        function_argspec = inspect.getargspec(Class().function)

wrapt/tests/test_adapter.py
75:        function1a_argspec = inspect.getargspec(_adapter)
76:        function1d_argspec = inspect.getargspec(function1d)
83:        bound_function1d_argspec = inspect.getargspec(bound_function1d)
110:        argspec = inspect.getargspec(_adapter)
120:        self.assertEqual(inspect.getargspec(_function_1), argspec)
122:        args = inspect.formatargspec(*argspec)
132:        self.assertEqual(inspect.getargspec(_function_2), argspec)
137:        argspec = inspect.getargspec(_adapter)
150:        self.assertEqual(inspect.getargspec(Class1.function), argspec)
151:        self.assertEqual(inspect.getargspec(instance1.function), argspec)
153:        args = inspect.formatargspec(*argspec)
166:        self.assertEqual(inspect.getargspec(Class2.function), argspec)
167:        self.assertEqual(inspect.getargspec(instance2.function), argspec)
172:        argspec = inspect.getargspec(_adapter)
186:        self.assertEqual(inspect.getargspec(Class1.function), argspec)
187:        self.assertEqual(inspect.getargspec(instance1.function), argspec)
189:        args = inspect.formatargspec(*argspec)
203:        self.assertEqual(inspect.getargspec(Class2.function), argspec)
204:        self.assertEqual(inspect.getargspec(instance2.function), argspec)
208:            argspec = inspect.getargspec(wrapped)
220:        argspec = inspect.getargspec(_function_1)

wrapt/tests/test_outer_staticmethod.py
98:        original_argspec = inspect.getargspec(Original.function)
99:        function_argspec = inspect.getargspec(Class.function)
105:        original_argspec = inspect.getargspec(Original().function)
106:        function_argspec = inspect.getargspec(Class().function)

wrapt/tests/test_function.py
60:        function1o_argspec = inspect.getargspec(function1o)
61:        function1d_argspec = inspect.getargspec(function1d)

wrapt/tests/test_adapter_py3.py
131:        args = inspect.formatargspec(*argspec2)
169:        args = inspect.formatargspec(*argspec2)
212:        args = inspect.formatargspec(*argspec2)

wrapt/tests/test_instancemethod.py
98:        original_argspec = inspect.getargspec(OldClass1o.function)
99:        function_argspec = inspect.getargspec(OldClass1d.function)
105:        original_argspec = inspect.getargspec(OldClass1o().function)
106:        function_argspec = inspect.getargspec(OldClass1d().function)
201:        original_argspec = inspect.getargspec(NewClass1o.function)
202:        function_argspec = inspect.getargspec(NewClass1d.function)
208:        original_argspec = inspect.getargspec(NewClass1o().function)
209:        function_argspec = inspect.getargspec(NewClass1d().function)

wrapt/tests/test_nested_function.py
69:        function1o_argspec = inspect.getargspec(function1o())
70:        function1d_argspec = inspect.getargspec(function1d())

wrapt/docs/decorators.rst
349:``getargspec()`` function from the ``inspect`` module can be used.
361:    >>> print(inspect.getargspec(function))
432:When using ``inspect.getargspec()`` the argument specification for the
482:is returned by ``inspect.getargspec()`` or ``inspect.getfullargspec()``,
483:or a string of the form which is returned by ``inspect.formatargspec()``.

wrapt/docs/changes.rst
192:* Code for ``inspect.getargspec()`` when using Python 2.6 was missing
200:* Ensure that ``inspect.getargspec()`` is only used with Python 2.6 where
314:  is returned by ``inspect.getargspec()``, or a string of the form which
315:  is returned by ``inspect.formatargspec()``. In these two cases the
323:          argspec = inspect.getargspec(wrapped)
352:          argspec = inspect.getargspec(wrapped)
655:* Using inspect.getargspec() now works correctly on bound methods when an

wrapt/blog/02-the-interaction-between-decorators-and-descriptors.md
313:`inspect.getargspec()` and `inspect.getsource()` will now work and

wrapt/blog/01-how-you-implemented-your-python-decorator-is-wrong.md
289:>>> print(inspect.getargspec(function))
306:>>> print(inspect.getargspec(function))
309:    print(inspect.getargspec(function))
310:  File ".../inspect.py", line 813, in getargspec

wrapt/src/wrapt/decorators.py
34:from inspect import ismethod, isclass, formatargspec
48:# functions such as inspect.getargspec(), inspect.getfullargspec(),
226:                        adapter = formatargspec(*adapter)

botocore/botocore/compat.py
72:        # changes when using getargspec with functools.partials.
132:        return inspect.getargspec(func)[2]

botocore/botocore/docs/method.py
100:    signature_params = inspect.formatargspec(

joblib/joblib/func_inspect.py
333:    # XXX: Should this use inspect.formatargvalues/formatargspec?

pluggy/CHANGELOG.rst
392:- avoid using deprecated-in-python3.5 getargspec method. Thanks

matplotlib/tools/boilerplate.py
87:    Format function default values as needed for inspect.formatargspec.

google-api-python-client/googleapiclient/_helpers.py
138:        args, _, _, defaults = inspect.getargspec(max_positional_args)

google-api-python-client/docs/epy/googleapiclient._helpers-pysrc.html
201:<a name="L141"></a><tt class="py-lineno">141</tt>  <tt class="py-line">        <tt class="py-name">args</tt><tt class="py-op">,</tt> <tt class="py-name">_</tt><tt class="py-op">,</tt> <tt class="py-name">_</tt><tt class="py-op">,</tt> <tt class="py-name">defaults</tt> <tt class="py-op">=</tt> <tt class="py-name">inspect</tt><tt class="py-op">.</tt><tt class="py-name">getargspec</tt><tt class="py-op">(</tt><tt class="py-name">max_positional_args</tt><tt class="py-op">)</tt> </tt>

traitlets/traitlets/utils/getargspec.py
2:    getargspec excerpted from:
17:def getargspec(func):
18:    """Like inspect.getargspec but supports functools.partial as well."""
23:        argspec = getargspec(orig_func)

traitlets/traitlets/traitlets.py
52:from .utils.getargspec import getargspec
751:        self.nargs = len(getargspec(cb)[0]) + offset

And maybe 9 ~8 actually call the methods:

  1. botocore
  2. client_python
  3. cython
  4. google-api-python-client
  5. grpc
  6. ipython
  7. pycodestyle
  8. pyrsistent
  9. wrapt
Details
pycodestyle/pycodestyle.py
186:        return inspect.getargspec(function)[0]

pyrsistent/pyrsistent/_field_common.py
69:        return 'ignore_extra' in inspect.getargspec(field.factory).args

pyrsistent/tests/memory_profiling.py
40:        fn_args = inspect.getargspec(fn)[0]

grpc/src/python/grpcio/grpc/_auth.py
33:        self._is_jwt = 'additional_claims' in inspect.getargspec(  # pylint: disable=deprecated-method

ipython/IPython/core/oinspect.py
200:def getargspec(obj):
209:    warnings.warn('`getargspec` function is deprecated as of IPython 7.10'
231:    return inspect.formatargspec(argspec['args'], argspec['varargs'],

client_python/prometheus_client/decorator.py
57:                inspect.getargspec(f)
67:        getargspec = inspect.getargspec
73:# getargspec has been deprecated in Python 3.5
78:def getargspec(f):
79:    """A replacement for inspect.getargspec"""
118:                        inspect.formatargspec(

cython/tests/run/py34_signature.pyx
8:    sig = inspect.Signature.from_callable
10:    sig = inspect.Signature.from_function

cython/Cython/Utility/CythonFunction.c
450://    // return Signature.from_function(op)
451://    signature = PyObject_CallMethodObjArgs(signature_class, PYIDENT("from_function"), op, NULL);

wrapt/tests/test_outer_classmethod.py
99:        original_argspec = inspect.getargspec(Original.function)
100:        function_argspec = inspect.getargspec(Class.function)
106:        original_argspec = inspect.getargspec(Original().function)
107:        function_argspec = inspect.getargspec(Class().function)

wrapt/tests/test_inner_classmethod.py
98:        original_argspec = inspect.getargspec(Original.function)
99:        function_argspec = inspect.getargspec(Class.function)
105:        original_argspec = inspect.getargspec(Original().function)
106:        function_argspec = inspect.getargspec(Class().function)

wrapt/tests/test_inner_staticmethod.py
98:        original_argspec = inspect.getargspec(Original.function)
99:        function_argspec = inspect.getargspec(Class.function)
105:        original_argspec = inspect.getargspec(Original().function)
106:        function_argspec = inspect.getargspec(Class().function)

wrapt/tests/test_adapter.py
75:        function1a_argspec = inspect.getargspec(_adapter)
76:        function1d_argspec = inspect.getargspec(function1d)
83:        bound_function1d_argspec = inspect.getargspec(bound_function1d)
110:        argspec = inspect.getargspec(_adapter)
120:        self.assertEqual(inspect.getargspec(_function_1), argspec)
122:        args = inspect.formatargspec(*argspec)
132:        self.assertEqual(inspect.getargspec(_function_2), argspec)
137:        argspec = inspect.getargspec(_adapter)
150:        self.assertEqual(inspect.getargspec(Class1.function), argspec)
151:        self.assertEqual(inspect.getargspec(instance1.function), argspec)
153:        args = inspect.formatargspec(*argspec)
166:        self.assertEqual(inspect.getargspec(Class2.function), argspec)
167:        self.assertEqual(inspect.getargspec(instance2.function), argspec)
172:        argspec = inspect.getargspec(_adapter)
186:        self.assertEqual(inspect.getargspec(Class1.function), argspec)
187:        self.assertEqual(inspect.getargspec(instance1.function), argspec)
189:        args = inspect.formatargspec(*argspec)
203:        self.assertEqual(inspect.getargspec(Class2.function), argspec)
204:        self.assertEqual(inspect.getargspec(instance2.function), argspec)
208:            argspec = inspect.getargspec(wrapped)
220:        argspec = inspect.getargspec(_function_1)

wrapt/tests/test_outer_staticmethod.py
98:        original_argspec = inspect.getargspec(Original.function)
99:        function_argspec = inspect.getargspec(Class.function)
105:        original_argspec = inspect.getargspec(Original().function)
106:        function_argspec = inspect.getargspec(Class().function)

wrapt/tests/test_function.py
60:        function1o_argspec = inspect.getargspec(function1o)
61:        function1d_argspec = inspect.getargspec(function1d)

wrapt/tests/test_adapter_py3.py
131:        args = inspect.formatargspec(*argspec2)
169:        args = inspect.formatargspec(*argspec2)
212:        args = inspect.formatargspec(*argspec2)

wrapt/tests/test_instancemethod.py
98:        original_argspec = inspect.getargspec(OldClass1o.function)
99:        function_argspec = inspect.getargspec(OldClass1d.function)
105:        original_argspec = inspect.getargspec(OldClass1o().function)
106:        function_argspec = inspect.getargspec(OldClass1d().function)
201:        original_argspec = inspect.getargspec(NewClass1o.function)
202:        function_argspec = inspect.getargspec(NewClass1d.function)
208:        original_argspec = inspect.getargspec(NewClass1o().function)
209:        function_argspec = inspect.getargspec(NewClass1d().function)

wrapt/tests/test_nested_function.py
69:        function1o_argspec = inspect.getargspec(function1o())
70:        function1d_argspec = inspect.getargspec(function1d())

wrapt/src/wrapt/decorators.py
34:from inspect import ismethod, isclass, formatargspec
48:# functions such as inspect.getargspec(), inspect.getfullargspec(),
226:                        adapter = formatargspec(*adapter)

botocore/botocore/compat.py
72:        # changes when using getargspec with functools.partials.
132:        return inspect.getargspec(func)[2]

botocore/botocore/docs/method.py
100:    signature_params = inspect.formatargspec(

google-api-python-client/googleapiclient/_helpers.py
138:        args, _, _, defaults = inspect.getargspec(max_positional_args)

@Carreau
Copy link
Contributor

Carreau commented Sep 29, 2021

You can remove IPython and traitlets from list of packages using it, where we use it in IPython is also deprecated functionalities, and if it's removed and actually affects users we'll patch rapidly. I was also the one that added the deprecation warnings in those functions, so I'm in favor or removal.

Earlier removal is also better to give more time to project to update, even if reverted later.

@ambv ambv merged commit d89fb9a into python:main Oct 20, 2021
@hugovk hugovk deleted the rm-deprecated-inspect branch October 20, 2021 18:50
shihai1991 added a commit to shihai1991/cpython that referenced this pull request Oct 21, 2021
* main: (263 commits)
  bpo-45521: Fix a bug in the obmalloc radix tree code. (pythonGH-29051)
  bpo-45522: Allow to disable freelists on build time (pythonGH-29056)
  bpo-34451: Document prompt and output toggle feature in html tutorial (pythonGH-27105)
  bpo-44019: Add operator.call() to __all__ for the operator module (pythonGH-29110)
  bpo-45315: PyType_FromSpec: Copy spec->name and have the type own the memory for its name (pythonGH-29103)
  bpo-44220: Export PyStructSequence_UnnamedField in the limited API (pythonGH-26331)
  bpo-44174: [Enum] add reference to name mangling (pythonGH-29116)
  bpo-45548: add some missing entries to `Modules/Setup` (pythonGH-29115)
  bpo-35673: Add a public alias for namespace package __loader__ attribute (python#29049)
  bpo-45192: Fix a bug that infers the type of an os.PathLike[bytes] object as str (pythonGH-28323)
  bpo-45527: Don't count cache hits, just misses. (pythonGH-29092)
  bpo-45320: Remove long-deprecated inspect methods (pythonGH-28618)
  bpo-41374: Remove obsolete exclusion of netinet/tcp.h on Cygwin (pythonGH-21649)
  bpo-45532: Replace 'default' with 'main' as default in sys.version (pythonGH-29100)
  bpo-45464: [doc] Explain that subclassing multiple exceptions is fragile (pythonGH-29094)
  Cleanup a couple of comments left on PR 28775 post-merge. (pythonGH-29079)
  bpo-45536: Check OpenSSL APIs in configure (pythonGH-29088)
  Add PEPs 593 & 647 to list of PEPs at top of typing docs (pythonGH-29097)
  Add a comment about how to fix bogus test_host_resolution_bad_address failures (python#29085)
  bpo-44525: Specialize simple Python calls. (pythonGH-29033)
  ...
erlend-aasland pushed a commit to erlend-aasland/devguide that referenced this pull request Sep 8, 2023
ggonzr added a commit to cms-PdmV/RelMonService2 that referenced this pull request Sep 13, 2023
Some features the old Pylint version used where removed in Python 3.11
For more details, please see: python/cpython#28618
ggonzr added a commit to cms-PdmV/RelMonService2 that referenced this pull request Sep 13, 2023
* Dockerfile

* Refactor: Black formatter

Also include mypy into requirements.txt file

* Remove support for configuration files & Update packages

All the required configuration is now being set as environment variables
Also, packages used are updated

* Include OIDC authentication

Include AuthenticationMiddleware via core_lib

* Configure callback to authenticate using an access token

This configures two modules: `remote_apparatus.py` for requesting an access token
via client credentials grant and `controller.py` to give the required credentials via
environment variables when the job is submitted

* Enable OpenShift container account to create folders into relmons/
for job submission

* Set environment variables into HTCondor config file

Reference: https://htcondor.readthedocs.io/en/latest/man-pages/condor_submit.html

* Bugfix: RelMon validation status

Fix a logic error on /api/update endpoint that impedes the batch job running into HTCondor to update the RelMon status

* Bugfix: Include some extra logging instruction to debug behaviour into HTCondor

* Bugfix: Use the updated version of remote_apparatus.py into HTCondor

Also, update how environment variables are sent to HTCondor into JDS configuration file

* Bugfix: Double quote for wrapping environment variables

* Bugfix: Repository version

Clone directly the specific desired branch

* Bugfix: Repair finished

Remove access token from log file

* Update Pylint workflow

Use Ubuntu 22.04 for the runner and update Python version to 3.11.4

* Update Pylint

Some features the old Pylint version used where removed in Python 3.11
For more details, please see: python/cpython#28618

* Modify Pylint score

* Pylint: Avoid to scan core_lib and venv packages

* Pylint & GitHub Actions

1. Update Pylint configuration (.pylintrc)
2. Raise the acceptance score to 9.75
3. Fix some linting issues: Encoding errors, broad exceptions, etc.
4. Increase the GitHub Action checkout version to 4
5. Disable linting for core_lib and venv packages

* core_lib & Repository version for remote execution

1. Update core_lib to use the version available in PdmVWebCore/master
2. Update `local/file_creator.py` to pull the remote code from `master` instead of `SSOMigrationV2`
AA-Turner pushed a commit to AA-Turner/devguide that referenced this pull request Sep 13, 2023
erlend-aasland pushed a commit to python/devguide that referenced this pull request Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants