Skip to content

Conversation

@hugovk
Copy link
Member

@hugovkhugovk commented Sep 29, 2021

These can be removed in Python 3.11.

https://bugs.python.org/issue45320

@hugovkhugovkforce-pushed the rm-deprecated-inspect branch from 3b214d0 to 720842aCompareSeptember 29, 2021 13:49
@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
MemberAuthor

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.py186: returninspect.getargspec(function)[0] backcall/backcall/_signatures.py97: returnSignature.from_function(obj) 514: deffrom_function(cls, func): pyrsistent/pyrsistent/_field_common.py69: return'ignore_extra'ininspect.getargspec(field.factory).argspyrsistent/tests/memory_profiling.py40: fn_args=inspect.getargspec(fn)[0] mako/mako/compat.py24: """getargspec based on fully vendored getfullargspec from Python 3.3."""mako/mako/ext/turbogears.py33: # in getargspecmako/doc/build/changelog.rst356: additionallyreplacetheuseof``inspect.getargspec()``underdecorator/CHANGES.md86:`decorator.getargspec`andprovided`decorator.getfullargspec`171:Removedanydependencefrom`inspect.getargspec`, whichisdeprecatedgrpc/src/python/grpcio/grpc/_auth.py33: self._is_jwt='additional_claims'ininspect.getargspec( # pylint: disable=deprecated-methodipython/IPython/core/oinspect.py200:defgetargspec(obj): 209: warnings.warn('`getargspec` function is deprecated as of IPython 7.10'231: returninspect.formatargspec(argspec['args'], argspec['varargs'], ipython/IPython/testing/tests/test_decorators.py20:defgetargspec(obj): 28: Modifiedversionofinspect.getargspecfromthePythonStandard148: dtargsr=getargspec(doctest_bad) python-prompt-toolkit/CHANGELOG680: *Addedthe`Validator.from_callable`classmethodforeasycreationof1084:-Don'tusedeprecatedinspect.getargspeconPython3.python-prompt-toolkit/docs/pages/asking_for_input.rst486:usethe :meth:`~prompt_toolkit.validation.Validator.from_callable`classmethod. 498: validator=Validator.from_callable( 508::meth:`~prompt_toolkit.validation.Validator.from_callable`turnsthatintoapython-prompt-toolkit/prompt_toolkit/validation.py51: -Orbypassingacallableto`Validator.from_callable`. 79: deffrom_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.py13:validator=Validator.from_callable( client_python/tests/test_core.py15:fromprometheus_client.decoratorimportgetargspec64: 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.py57: inspect.getargspec(f) 67: getargspec=inspect.getargspec73:# getargspec has been deprecated in Python 3.578:defgetargspec(f): 79: """A replacement for inspect.getargspec"""118: inspect.formatargspec( werkzeug/CHANGES.rst888: `inspect.getargspec`isgonein3.6cython/tests/run/py34_signature.pyx8: sig=inspect.Signature.from_callable10: sig=inspect.Signature.from_functioncython/Cython/Utility/CythonFunction.c450:////returnSignature.from_function(op) 451://signature=PyObject_CallMethodObjArgs(signature_class, PYIDENT("from_function"), op, NULL); wrapt/tests/test_outer_classmethod.py99: 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.py98: 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.py98: 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.py75: 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.py98: 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.py60: function1o_argspec=inspect.getargspec(function1o) 61: function1d_argspec=inspect.getargspec(function1d) wrapt/tests/test_adapter_py3.py131: args=inspect.formatargspec(*argspec2) 169: args=inspect.formatargspec(*argspec2) 212: args=inspect.formatargspec(*argspec2) wrapt/tests/test_instancemethod.py98: 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.py69: function1o_argspec=inspect.getargspec(function1o()) 70: function1d_argspec=inspect.getargspec(function1d()) wrapt/docs/decorators.rst349:``getargspec()``functionfromthe``inspect``modulecanbeused. 361: >>>print(inspect.getargspec(function)) 432:Whenusing``inspect.getargspec()``theargumentspecificationforthe482:isreturnedby``inspect.getargspec()``or``inspect.getfullargspec()``, 483:orastringoftheformwhichisreturnedby``inspect.formatargspec()``. wrapt/docs/changes.rst192:*Codefor``inspect.getargspec()``whenusingPython2.6wasmissing200:*Ensurethat``inspect.getargspec()``isonlyusedwithPython2.6where314: isreturnedby``inspect.getargspec()``, orastringoftheformwhich315: isreturnedby``inspect.formatargspec()``. Inthesetwocasesthe323: argspec=inspect.getargspec(wrapped) 352: argspec=inspect.getargspec(wrapped) 655:*Usinginspect.getargspec() nowworkscorrectlyonboundmethodswhenanwrapt/blog/02-the-interaction-between-decorators-and-descriptors.md313:`inspect.getargspec()`and`inspect.getsource()`willnowworkandwrapt/blog/01-how-you-implemented-your-python-decorator-is-wrong.md289:>>>print(inspect.getargspec(function)) 306:>>>print(inspect.getargspec(function)) 309: print(inspect.getargspec(function)) 310: File".../inspect.py", line813, ingetargspecwrapt/src/wrapt/decorators.py34:frominspectimportismethod, isclass, formatargspec48:# functions such as inspect.getargspec(), inspect.getfullargspec(),226: adapter=formatargspec(*adapter) botocore/botocore/compat.py72: # changes when using getargspec with functools.partials.132: returninspect.getargspec(func)[2] botocore/botocore/docs/method.py100: signature_params=inspect.formatargspec( joblib/joblib/func_inspect.py333: # XXX: Should this use inspect.formatargvalues/formatargspec?pluggy/CHANGELOG.rst392:-avoidusingdeprecated-in-python3.5getargspecmethod. Thanksmatplotlib/tools/boilerplate.py87: Formatfunctiondefaultvaluesasneededforinspect.formatargspec. beam/sdks/python/apache_beam/transforms/ptransform.py375: fn_type_hints=IOTypeHints.from_callable(self.expand) beam/sdks/python/apache_beam/transforms/core.py565: deffrom_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: deffrom_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.py118: combine_fn=core.CombineFn.from_callable(combine_fn) beam/sdks/python/apache_beam/typehints/decorators_test.py68: 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.py239: deffrom_callable(cls, fn): 285: msg= ['from_callable(%s)'%name, ' signature: %s'%signature] beam/CHANGES.md371:*Non-idempotentcombinersbuiltvia`CombineFn.from_callable()`or`CombineFn.maybe_from_callable()`canleadtoincorrectbehavior. ([BEAM-11522](https://issues.apache.org/jira/browse/BEAM-11522)). google-api-python-client/googleapiclient/_helpers.py138: args, _, _, defaults=inspect.getargspec(max_positional_args) google-api-python-client/docs/epy/googleapiclient._helpers-pysrc.html201:<aname="L141"></a><ttclass="py-lineno">141</tt><ttclass="py-line"><ttclass="py-name">args</tt><ttclass="py-op">,</tt><ttclass="py-name">_</tt><ttclass="py-op">,</tt><ttclass="py-name">_</tt><ttclass="py-op">,</tt><ttclass="py-name">defaults</tt><ttclass="py-op">=</tt><ttclass="py-name">inspect</tt><ttclass="py-op">.</tt><ttclass="py-name">getargspec</tt><ttclass="py-op">(</tt><ttclass="py-name">max_positional_args</tt><ttclass="py-op">)</tt></tt>traitlets/docs/source/changelog.rst269: -traitlets.utils.getargspec.PY3traitlets/traitlets/utils/getargspec.py2: getargspecexcerptedfrom: 17:defgetargspec(func): 18: """Like inspect.getargspec but supports functools.partial as well."""23: argspec=getargspec(orig_func) traitlets/traitlets/traitlets.py52:from .utils.getargspecimportgetargspec751: 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.py186: returninspect.getargspec(function)[0] pyrsistent/pyrsistent/_field_common.py69: return'ignore_extra'ininspect.getargspec(field.factory).argspyrsistent/tests/memory_profiling.py40: fn_args=inspect.getargspec(fn)[0] mako/mako/compat.py24: """getargspec based on fully vendored getfullargspec from Python 3.3."""mako/doc/build/changelog.rst356: additionallyreplacetheuseof``inspect.getargspec()``underdecorator/CHANGES.md86:`decorator.getargspec`andprovided`decorator.getfullargspec`171:Removedanydependencefrom`inspect.getargspec`, whichisdeprecatedgrpc/src/python/grpcio/grpc/_auth.py33: self._is_jwt='additional_claims'ininspect.getargspec( # pylint: disable=deprecated-methodipython/IPython/core/oinspect.py200:defgetargspec(obj): 209: warnings.warn('`getargspec` function is deprecated as of IPython 7.10'231: returninspect.formatargspec(argspec['args'], argspec['varargs'], ipython/IPython/testing/tests/test_decorators.py20:defgetargspec(obj): 28: Modifiedversionofinspect.getargspecfromthePythonStandard148: dtargsr=getargspec(doctest_bad) python-prompt-toolkit/CHANGELOG680: *Addedthe`Validator.from_callable`classmethodforeasycreationof1084:-Don'tusedeprecatedinspect.getargspeconPython3.client_python/prometheus_client/decorator.py57: inspect.getargspec(f) 67: getargspec=inspect.getargspec73:# getargspec has been deprecated in Python 3.578:defgetargspec(f): 79: """A replacement for inspect.getargspec"""118: inspect.formatargspec( werkzeug/CHANGES.rst888: `inspect.getargspec`isgonein3.6cython/tests/run/py34_signature.pyx8: sig=inspect.Signature.from_callable10: sig=inspect.Signature.from_functioncython/Cython/Utility/CythonFunction.c450:////returnSignature.from_function(op) 451://signature=PyObject_CallMethodObjArgs(signature_class, PYIDENT("from_function"), op, NULL); wrapt/tests/test_outer_classmethod.py99: 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.py98: 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.py98: 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.py75: 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.py98: 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.py60: function1o_argspec=inspect.getargspec(function1o) 61: function1d_argspec=inspect.getargspec(function1d) wrapt/tests/test_adapter_py3.py131: args=inspect.formatargspec(*argspec2) 169: args=inspect.formatargspec(*argspec2) 212: args=inspect.formatargspec(*argspec2) wrapt/tests/test_instancemethod.py98: 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.py69: function1o_argspec=inspect.getargspec(function1o()) 70: function1d_argspec=inspect.getargspec(function1d()) wrapt/docs/decorators.rst349:``getargspec()``functionfromthe``inspect``modulecanbeused. 361: >>>print(inspect.getargspec(function)) 432:Whenusing``inspect.getargspec()``theargumentspecificationforthe482:isreturnedby``inspect.getargspec()``or``inspect.getfullargspec()``, 483:orastringoftheformwhichisreturnedby``inspect.formatargspec()``. wrapt/docs/changes.rst192:*Codefor``inspect.getargspec()``whenusingPython2.6wasmissing200:*Ensurethat``inspect.getargspec()``isonlyusedwithPython2.6where314: isreturnedby``inspect.getargspec()``, orastringoftheformwhich315: isreturnedby``inspect.formatargspec()``. Inthesetwocasesthe323: argspec=inspect.getargspec(wrapped) 352: argspec=inspect.getargspec(wrapped) 655:*Usinginspect.getargspec() nowworkscorrectlyonboundmethodswhenanwrapt/blog/02-the-interaction-between-decorators-and-descriptors.md313:`inspect.getargspec()`and`inspect.getsource()`willnowworkandwrapt/blog/01-how-you-implemented-your-python-decorator-is-wrong.md289:>>>print(inspect.getargspec(function)) 306:>>>print(inspect.getargspec(function)) 309: print(inspect.getargspec(function)) 310: File".../inspect.py", line813, ingetargspecwrapt/src/wrapt/decorators.py34:frominspectimportismethod, isclass, formatargspec48:# functions such as inspect.getargspec(), inspect.getfullargspec(),226: adapter=formatargspec(*adapter) botocore/botocore/compat.py72: # changes when using getargspec with functools.partials.132: returninspect.getargspec(func)[2] botocore/botocore/docs/method.py100: signature_params=inspect.formatargspec( joblib/joblib/func_inspect.py333: # XXX: Should this use inspect.formatargvalues/formatargspec?pluggy/CHANGELOG.rst392:-avoidusingdeprecated-in-python3.5getargspecmethod. Thanksmatplotlib/tools/boilerplate.py87: Formatfunctiondefaultvaluesasneededforinspect.formatargspec. google-api-python-client/googleapiclient/_helpers.py138: args, _, _, defaults=inspect.getargspec(max_positional_args) google-api-python-client/docs/epy/googleapiclient._helpers-pysrc.html201:<aname="L141"></a><ttclass="py-lineno">141</tt><ttclass="py-line"><ttclass="py-name">args</tt><ttclass="py-op">,</tt><ttclass="py-name">_</tt><ttclass="py-op">,</tt><ttclass="py-name">_</tt><ttclass="py-op">,</tt><ttclass="py-name">defaults</tt><ttclass="py-op">=</tt><ttclass="py-name">inspect</tt><ttclass="py-op">.</tt><ttclass="py-name">getargspec</tt><ttclass="py-op">(</tt><ttclass="py-name">max_positional_args</tt><ttclass="py-op">)</tt></tt>traitlets/traitlets/utils/getargspec.py2: getargspecexcerptedfrom: 17:defgetargspec(func): 18: """Like inspect.getargspec but supports functools.partial as well."""23: argspec=getargspec(orig_func) traitlets/traitlets/traitlets.py52:from .utils.getargspecimportgetargspec751: 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.py186: returninspect.getargspec(function)[0] pyrsistent/pyrsistent/_field_common.py69: return'ignore_extra'ininspect.getargspec(field.factory).argspyrsistent/tests/memory_profiling.py40: fn_args=inspect.getargspec(fn)[0] grpc/src/python/grpcio/grpc/_auth.py33: self._is_jwt='additional_claims'ininspect.getargspec( # pylint: disable=deprecated-methodipython/IPython/core/oinspect.py200:defgetargspec(obj): 209: warnings.warn('`getargspec` function is deprecated as of IPython 7.10'231: returninspect.formatargspec(argspec['args'], argspec['varargs'], client_python/prometheus_client/decorator.py57: inspect.getargspec(f) 67: getargspec=inspect.getargspec73:# getargspec has been deprecated in Python 3.578:defgetargspec(f): 79: """A replacement for inspect.getargspec"""118: inspect.formatargspec( cython/tests/run/py34_signature.pyx8: sig=inspect.Signature.from_callable10: sig=inspect.Signature.from_functioncython/Cython/Utility/CythonFunction.c450:////returnSignature.from_function(op) 451://signature=PyObject_CallMethodObjArgs(signature_class, PYIDENT("from_function"), op, NULL); wrapt/tests/test_outer_classmethod.py99: 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.py98: 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.py98: 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.py75: 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.py98: 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.py60: function1o_argspec=inspect.getargspec(function1o) 61: function1d_argspec=inspect.getargspec(function1d) wrapt/tests/test_adapter_py3.py131: args=inspect.formatargspec(*argspec2) 169: args=inspect.formatargspec(*argspec2) 212: args=inspect.formatargspec(*argspec2) wrapt/tests/test_instancemethod.py98: 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.py69: function1o_argspec=inspect.getargspec(function1o()) 70: function1d_argspec=inspect.getargspec(function1d()) wrapt/src/wrapt/decorators.py34:frominspectimportismethod, isclass, formatargspec48:# functions such as inspect.getargspec(), inspect.getfullargspec(),226: adapter=formatargspec(*adapter) botocore/botocore/compat.py72: # changes when using getargspec with functools.partials.132: returninspect.getargspec(func)[2] botocore/botocore/docs/method.py100: signature_params=inspect.formatargspec( google-api-python-client/googleapiclient/_helpers.py138: args, _, _, defaults=inspect.getargspec(max_positional_args)

@Carreau
Copy link
Contributor

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.

@ambvambv merged commit d89fb9a into python:mainOct 20, 2021
@hugovkhugovk 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 freeto 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.

5 participants

@hugovk@ambv@Carreau@the-knights-who-say-ni@bedevere-bot