[Python-Dev] PEP 362 Third Revision

Nick Coghlan ncoghlan at gmail.com
Thu Jun 14 12:00:27 CEST 2012


On Jun 14, 2012 2:31 PM, "Alexandre Zani" <alexandre.zani at gmail.com> wrote:

> Why do we look at __wrapped__ only if the object is a FunctionType?
> Why not support __wrapped__ on all callables?

Fair question - duck typing here makes more sense to me, too.

>
> Why special-case functools.partial? Couldn't functools.partial just
> set __signature__ itself? Is that because of inspect's dependency on
> functools?

Got it in one. Really, it's the same reason we don't burden the builtin
callable machinery with it - to ensure the dependencies only flow in one
direction.

> Just a thought: Do we want to include the docstring? A function's
> docstring is often intimately tied to its signature. (Or at least, a
> lot of us try to write docstrings that effectively describe the
> function's signature)

No, combining the signature with other details like the name and docstring
is the task of higher level interfaces like pydoc.

Cheers,
Nick.

--
Sent from my phone, thus the relative brevity :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20120614/47854d11/attachment.html>


More information about the Python-Dev mailing list