This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: inspect.getargspec() returns wrong spec for builtins
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.4, Python 3.5
process
Status: closed Resolution: duplicate
Dependencies: Superseder: sphinx - building muppy docs fails on Linux
View: 3934
Assigned To: Nosy List: larry, r.david.murray, suor, yselivanov
Priority: normal Keywords:

Created on 2014-08-15 05:20 by suor, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (5)
msg225338 - (view) Author: Alexander Schepanovski (suor) Date: 2014-08-15 05:20
inspect.getargspec() returns empty ArgSpec for map() and filter():

    >>> import inspect
    >>> inspect.getargspec(map)
    ArgSpec(args=[], varargs=None, keywords=None, defaults=None)
    >>> inspect.getargspec(filter)
    ArgSpec(args=[], varargs=None, keywords=None, defaults=None)

Not sure if other builtins affected.
msg225349 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2014-08-15 13:24
These used to raise an error.  Not sure if the fact that they don't now is intentional or not (eventually they will return a real value when the argument clinic project is finished).
msg227634 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2014-09-26 16:44
The problem is that map & filter are classes, and their __init__ and __new__ methods do not provide any text_signature, hence signature uses the one from object.__init__.
msg227636 - (view) Author: Larry Hastings (larry) * (Python committer) Date: 2014-09-26 17:15
We should be able to get proper signatures for 3.5.  For 3.4, probably the best thing is to prevent the signature / raise an error.
msg244511 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2015-05-31 03:00
This was fixed in issue #23934
History
Date User Action Args
2022-04-11 14:58:07adminsetgithub: 66399
2015-05-31 03:00:01yselivanovsetstatus: open -> closed
superseder: sphinx - building muppy docs fails on Linux
messages: + msg244511

resolution: duplicate
stage: resolved
2014-09-26 17:15:08larrysetmessages: + msg227636
2014-09-26 16:44:44yselivanovsetnosy: + larry
2014-09-26 16:44:01yselivanovsetmessages: + msg227634
2014-08-25 15:35:18yselivanovsetnosy: + yselivanov
2014-08-15 13:24:08r.david.murraysetnosy: + r.david.murray
messages: + msg225349
2014-08-15 05:20:32suorcreate