Was: Annotations (and static typing), Now:Sharing __annotations__
![](https://secure.gravatar.com/avatar/26eddbf634fed5eed3ab137592fba21e.jpg?s=120&d=mm&r=g)
On Aug 24, 2014, at 9:22 PM, Chris Angelico <rosuav@gmail.com> wrote:
On Mon, Aug 25, 2014 at 11:15 AM, Cem Karan <cfkaran2@gmail.com> wrote:
Because of this, using 'annotizer' as a key is meaningless; there could be many instances live at the same time.
But that's exactly my point! You don't use "annotizer" as the key, you use annotizer. You use the object itself, not the string.
And now I feel dumb... You're right of course, by passing in the object itself, there are no namespace conflicts, inter-project coordination is nil, and on top of it all, you can perform introspection of the annotizer object itself to find out more information about it. UUIDs aren't required at all. Right-o, with your permission Chris, I'd like to amend my proposal so that instead of using UUIDs, the annotizer object itself is used as the key. Depending on what work is like this week, I'll modify my code to do this. Thanks, Cem Karan
![](https://secure.gravatar.com/avatar/d67ab5d94c2fed8ab6b727b62dc1b213.jpg?s=120&d=mm&r=g)
On Mon, Aug 25, 2014 at 12:04 PM, Cem Karan <cfkaran2@gmail.com> wrote:
On Aug 24, 2014, at 9:22 PM, Chris Angelico <rosuav@gmail.com> wrote:
On Mon, Aug 25, 2014 at 11:15 AM, Cem Karan <cfkaran2@gmail.com> wrote:
Because of this, using 'annotizer' as a key is meaningless; there could be many instances live at the same time.
But that's exactly my point! You don't use "annotizer" as the key, you use annotizer. You use the object itself, not the string.
And now I feel dumb...
Ehh, don't feel dumb, my explanation wasn't all that clear - it's hard to be clear in email. It's like when Rapunzel says, "I like Eugene Fitzherbert better than Flynn Rider", and the scriptwriters are (presumably deliberately) ambiguous as to whether she's putting quotes around those names ("I prefer to call you Eugene than Flynn") or not ("I prefer the persona of Eugene to that of Flynn"). As long as the objects have useful reprs, you can get most of the benefit of strings anyway - you can print them out and get an idea of what they're all about, which UUIDs wouldn't give you. You might have a collision of representation (if you have multiple annotizer instances), or you might fall back on incorporating the id() in the repr, but either way can't be worse than nothing. ChrisA
participants (2)
-
Cem Karan
-
Chris Angelico