[Python-ideas] Conventions for function annotations

Andrew Svetlov andrew.svetlov at gmail.com
Mon Dec 3 12:53:59 CET 2012


Ok, you right. I told about access mechanism only.

On Mon, Dec 3, 2012 at 1:51 PM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> On Mon, Dec 3, 2012 at 9:45 PM, Andrew Svetlov <andrew.svetlov at gmail.com>
> wrote:
>>
>> On Mon, Dec 3, 2012 at 1:08 PM, Nick Coghlan <ncoghlan at gmail.com> wrote:
>> > * the advisability of using the __annotations__ dictionary for long-term
>> > introspection, rather than using the decorator to move the information
>> > to a
>> > purpose-specific location in a separate function attribute
>> My 5 cents: perhaps you don't need to use __annotations__ at all,
>> Signature object (PEP 362) gives more convenient way for gathering
>> information about function spec.
>
>
> I don't quite understand that comment - PEP 362 is purely an access
> mechanism. The underlying storage is still in __annotations__ (at least as
> far any annotations are concerned).
>
> However, using separate storage is a natural consequence of also providing
> an explicit decorator factory API, so I didn't bring it up.
>
>
> Cheers,
> Nick.
>
> --
> Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia



-- 
Thanks,
Andrew Svetlov



More information about the Python-ideas mailing list