[Python-Dev] A Desperate Plea For Introspection (aka: BDFAP Needed)

Guido van Rossum guido at python.org
Fri Jun 22 21:24:43 CEST 2012


On Fri, Jun 22, 2012 at 12:21 PM, Christian Heimes <lists at cheimes.de> wrote:
> Am 22.06.2012 20:52, schrieb Guido van Rossum:
>> (5) Too bad there's no proposal for adding signatures to builtin
>> functions/methods, but understood.
>
> Larry et al. did an experiment with a mutable __signature__ attribute to
> PyCFunction. He immediately backed out and removed the attribute as I
> explained that it breaks isolation between subinterpreter instances.

Good point. Maybe the PEP could explain this (remember that a good PEP
also mentioned some rejected ideas and the reason why they were
rejected).

> The PEP is already complex enough and went to several incarnations. It
> was a wise decision to focus on the features that could be implemented
> before the first beta is released. Kudos for pulling it off, Larry!

Indeed, limiting the scope in this way was very wise.

> Signatures for builtin functions should be handled by a new PEP. We need
> a way to extract or define the signatures (perhaps parse the C code and
> parse PyArg_* signatures) and a secure way to store the signature
> (perhaps implement the signature class in C?). That's a LOT of work.

Agreed it's an open problem. I just hope someone will tackle it next.

-- 
--Guido van Rossum (python.org/~guido)


More information about the Python-Dev mailing list