Brett Cannon wrote:
> On 5/2/06, Nick Coghlan <[EMAIL PROTECTED]> wrote:
>> All of the use cases I can think of (introspection for documentation
>> purposes
>> or argument checking purposes) don't really suffer either way
>> regardless of
>> whether the signature retrieval is spelt "obj.__signature__" or
>> "inspect.getsignature(obj)".
>>
>
> It does for decorators. How do you make sure that a decorator uses
> the signature object of the wrapped function instead of the decorator?
> Or are you saying to just not worry about that right now?
Ah, good point. In that case, I'd be in favour of including the attribute in
the PEP, and having inspect.getsignature() check for that attribute before
manually building a signature object from the function and its code object.
The other nice thing about the attribute is that it allows otherwise
uninspectable functions (like C functions) to choose to declare their API for
introspection purposes.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---------------------------------------------------------------
http://www.boredomandlaziness.org
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com