[issue8639] Allow callable objects in inspect.getfullargspec
Yury Selivanov added the comment: This is now fixed in #17481. -- dependencies: +inspect.getfullargspec should use __signature__ nosy: +yselivanov resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8639 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8639] Allow callable objects in inspect.getfullargspec
Mark Lawrence added the comment: Would someone please review the patch file as it's out of my league. -- nosy: +BreamoreBoy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8639 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8639] Allow callable objects in inspect.getfullargspec
Changes by Maxim Bublis b...@codemonkey.ru: Removed file: http://bugs.python.org/file22825/inspect.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8639 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8639] Allow callable objects in inspect.getfullargspec
Maxim Bublis b...@codemonkey.ru added the comment: I've ran into the same problem with getfullargspec not supporting callables, so I've written patch with docs and tests, that adds support for any Python callable. As a result of getfullargspec's implementation change, getargspec function also supports callables. -- keywords: +patch nosy: +maxbublis Added file: http://bugs.python.org/file22825/inspect.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8639 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8639] Allow callable objects in inspect.getfullargspec
Benjamin Peterson benja...@python.org added the comment: I'm -0.5. I think the current patch makes too many assumptions for the caller. For example, someone calling a class may really desire __new__'s signature, not that of __init__. Moreover, conceptually, getargspec() returns the argspec of a directly callable *function* or *method*. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8639 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8639] Allow callable objects in inspect.getfullargspec
Michael Foord mich...@voidspace.org.uk added the comment: Right. For a callable object (instance with __call__ method), it's unambiguous which signature you want. For a class it's ambiguous. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8639 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8639] Allow callable objects in inspect.getfullargspec
Maxim Bublis b...@codemonkey.ru added the comment: Agree, support for __new__ or __init__ methods would add some ambiquity, so i've decided to drop __init__ support from patch. Patch has been reuploaded. -- Added file: http://bugs.python.org/file22826/inspect2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8639 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8639] Allow callable objects in inspect.getfullargspec
Nick Coghlan ncogh...@gmail.com added the comment: This API has changed around a bit in 3.x, so it is actually inspect.getfullargspec that needs to change (getargspec will inherit the new behaviour though, since it uses getfullargspec internally) With appropriate docs and tests updates, I don't see a problem with adding the feature, though. Docs should note and tests should ensure that this only goes one level deep - if __call__ isn't a real function either, inspect shouldn't try to follow the descriptor chain down the rabbit hole. Anything else runs the risk of infinite recursion in the face of things like inspect.getargspec(list). -- title: Allow callable objects in inspect.getargspec - Allow callable objects in inspect.getfullargspec ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8639 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8639] Allow callable objects in inspect.getfullargspec
Michael Foord mich...@voidspace.org.uk added the comment: I can produce a patch w/ tests and documentation for you to review Nick. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8639 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com