[Python-ideas] Was: Annotations (and static typing), Now:Sharing __annotations__
Chris Angelico
rosuav at gmail.com
Mon Aug 25 01:57:37 CEST 2014
On Mon, Aug 25, 2014 at 9:28 AM, Cem Karan <cfkaran2 at gmail.com> wrote:
> On Aug 24, 2014, at 7:22 PM, Chris Angelico <rosuav at gmail.com> wrote:
>
>> On Mon, Aug 25, 2014 at 9:17 AM, Cem Karan <cfkaran2 at gmail.com> wrote:
>>> @doc(a, "docs about a")
>>> @type(a, set(range(10)))
>>> def foo(a):
>>> pass
>>
>> If this is your proposal, then how do UUIDs even help? You already
>> effectively piggy-back off the standard module import system for
>> uniqueness. Surely that's going to do everything that UUIDs would?
>
> I'm not sure if I follow what you're saying. Do you mean 'if everyone is using my annotizer library, why bother with UUIDs, because each decorator will have a different meaning enforced by the import system'?
doc and type can't conflict, because they're separate names. (Though
"type" would need to be renamed to avoid a conflict, unless you're
suggesting that the type type should grow this functionality.) If they
use their own selves as the keys (nobody ever said the keys have to be
strings), there cannot be a conflict. The UUID scheme doesn't add
anything that can't be done with existing objects with no hassle.
ChrisA
More information about the Python-ideas
mailing list