[Python-Dev] PEP 362: 4th edition

Victor Stinner victor.stinner at gmail.com
Fri Jun 15 22:48:42 CEST 2012


> 1. Should we keep 'Parameter.implemented' or not.  *Please vote*

It looks like only few functions of the os module will use it. Even
for the os module, I'm not convinced that it is the appropriate
solution to indicate if a feature is supported or not. I would prefer
something like os.path.supports_unicode_filename, hasattr(os, 'fork'),
or something else.

And such attribute might only be useful if changes proposed in the
issue #14626 are accepted, but the issue is still open and not
everybody do agree on the idea...

>    - If the object has a ``__signature__`` attribute and if it
>      is not ``None`` - return a deepcopy of it

I still disagree with the deepcopy. I read somewhere that Python
developers are consenting adult. If someone really want to modify a
Signature, it would be nice to provide a simple method to copy it. But
I don't see why it should be copied *by default*. I expect that
modifying a signature is more rare than just reading a signature.

>        - If it is ``None`` and the object is an instance of
>          ``BuiltinFunction``, raise a ``ValueError``

Would it be possible to only create a signature for builtin the first
time that you read its __signature__ attribute? I don't know how to
implement such behaviour on a builtin function. I don't know if it's
important to decide this right now.

I don't want to create a signature at startup if it is not used,
because it would waste memory (as docstrings? :-)). Or we might drop
__signature__ if python -O is used?

Victor


More information about the Python-Dev mailing list