Guido van Rossum <gu...@python.org> added the comment:

(Serhiy: I think you meant Nuitka, not numba -- Nuitka is a Python-to-C++ 
compiler, and Kay is its author. Somehow he managed to confuse us all. :-)

I suspect that the way `python3 -m test` runs the tests whose name you pass on 
the command line causes there to be no `__annotations__` global, while the way 
`python3 -m test.test_opcodes` runs its argument causes there to be one.  It 
seems that when a module is run as `__main__` it always is endowed with an 
`__annotations__` global, but when it is an imported module, `__annotations__` 
is only created when there is at least one top-level annotation.

I don't know why the global is always created for a `__main__`, but I suspect 
there's a good reason; the test will have to cope, because I think it should be 
able to run the tests either way.

----------

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

Reply via email to