On 17 January 2016 at 03:23, Andrew Barnert via Python-Dev <python-dev@python.org> wrote: > On Jan 16, 2016, at 08:05, Aviv Cohn via Python-Dev <python-dev@python.org> > wrote: > > The `getargspec` function in the `inspect` module enforces the input > parameter to be either a method or a function. > > > The `getargspec` already works with classes, callable objects, and some > builtins. > > It's also deprecated, in part because its API can't handle various features > (like keyword-only arguments). There is an extended version that can handle > some of those features, but as of 3.5 that one is deprecated as well. > > The `signature` function is much easier to use, as well as being more > powerful.
As Andrew states here, the limitations of getargspec() and getfullargspec() are why they were deprecated in favour of inspect.signature() in Python 3.3: https://docs.python.org/3/library/inspect.html#introspecting-callables-with-the-signature-object The funcsigs project provides a backport of much of that functionality to earlier Python versions: https://pypi.python.org/pypi/funcsigs Cheers, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com