Larry Hastings <la...@hastings.org> added the comment:

> There may be a (deliberate? :-) misunderstanding. When I wrote about
> "you" inspecting code by a "3rd party" I meant that as a symmetric
> relationship -- the "you" could be a library and from the library's
> POV the "3rd party" could be you (or me).

I wasn't deliberately misunderstanding you.  And I understand what you're 
saying.  But the relationship isn't perfectly symmetric from a pragmatic 
perspective.

Let's say I write some code, and I also call into a third-party library.  I've 
annotated one of my objects, and the third-party library calls 
inspect.signature() on my object.  If my annotations are strings, and they 
aren't eval()uatable, then boom! it raises an exception, showing me a bug in my 
code, and I can fix it straight away.

On the other hand: let's say I write some code, and I call into a third-party 
library.  If the third-party library has an annotated object, and I call 
inspect.signature() on that object, and the annotations happen to be strings 
that aren't evaluatable, boom! it's showing me a bug in the third-party 
library.  Now I have a much larger headache: I have to notify this third-party 
vendor, convince them to fix the bug, wait for a new release, etc etc etc.  
(And in the meantime maybe I add eval_str=False to my inspect.signature() call.)

It's my assumption that the former scenario is far more likely than the latter, 
which is good news because it's way easier to deal with.  The latter scenario 
is plausible, and much more inconvenient, but I think it's far less likely.  If 
I'm wrong, and there are lots of third-party libraries with stringized 
annotations that could have errors lurking in them, I'd very much like to know 
that.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43817>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to