Add introspection information for builtins #63873
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
assignee = 'https://github.com/larryhastings' closed_at = <Date 2013-11-23.23:39:10.883> created_at = <Date 2013-11-20.23:52:26.200> labels = ['interpreter-core', 'type-bug'] title = 'Add introspection information for builtins' updated_at = <Date 2013-11-23.23:39:10.883> user = 'https://github.com/larryhastings'
activity = <Date 2013-11-23.23:39:10.883> actor = 'larry' assignee = 'larry' closed = True closed_date = <Date 2013-11-23.23:39:10.883> closer = 'larry' components = ['Interpreter Core'] creation = <Date 2013-11-20.23:52:26.200> creator = 'larry' dependencies =  files = ['32739', '32763', '32785', '32815'] hgrepos =  issue_num = 19674 keywords =  message_count = 16.0 messages = ['203549', '203550', '203551', '203575', '203576', '203583', '203607', '203667', '203672', '203684', '203797', '203827', '203908', '204026', '204120', '204129'] nosy_count = 8.0 nosy_names = ['gvanrossum', 'barry', 'brett.cannon', 'georg.brandl', 'ncoghlan', 'larry', 'python-dev', 'serhiy.storchaka'] pr_nums =  priority = 'normal' resolution = 'fixed' stage = 'resolved' status = 'closed' superseder = None type = 'behavior' url = 'https://bugs.python.org/issue19674' versions = ['Python 3.4']
The text was updated successfully, but these errors were encountered:
Let's see if we can get introspection information for builtins using the Clinic for 3.4.
Georg suggested part of the approach while we were hanging out in Tokyo. I'd considered it previously before but dispensed with the idea because it seemed too loopy. Actually it seems to work great.
Advantages of this approach:
Disadvantages of this approach:
The next step is probably to convert pydoc to use inspect.signature instead of the manky old methods it currently uses. After that, clean up the patch, and add a unit test or two.
What do you think?
I was deliberately trying to avoid something that a person might do by accident. Also, "def (" is consistently only five bytes, whereas "pterodactyl (" or whatever will often be much longer, in case static data size is a concern.
But I could switch it to that if you think that's better. Certainly it's a tiny amount more readable.
(I don't think this would make the docstrings compatible with sphinx autodoc though.)
Fresh patch attached. pydoc now uses inspect.signature instead of inspect.getfullargspec to generate the arguments for the function, and supports builtins. That's everything :D
Planning on checking this in pretty soon, to get it in for beta (which hopefully still gets tagged today).