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

I admit I hadn't looked that closely at Jelle's PR.  You're right, its effects 
on code size should be minimal.

If I'm reading it correctly, Jelle's PR would suppress NameError by replacing 
the failed value with a new "AnnotationName" object.  It wouldn't handle any 
other exceptions (e.g. ValueError).

Also, as currently implemented it doesn't permit getting attributes or indexing 
into the AnnotationName--if "o" is the object we failed to look up, "o.value" 
and "o[1]" would raise exceptions.  The AnnotationName could be extended with 
__getattr__ and __getitem__, but this makes it even more opinionated.

Also, the PR only adds LOAD_ANNOTATION_GLOBAL; it would presumably also need 
LOAD_ANNOTATION_NAME and LOAD_ANNOTATION_CLASSDEREF.  (I don't think we'd need 
LOAD_ANNOTATION_LOCAL.)

I'll file these comments on the PR.

----------

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

Reply via email to