This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gvanrossum
Recipients Mark.Shannon, gvanrossum, kayhayen, levkivskyi, serhiy.storchaka, terry.reedy
Date 2018-07-21.03:14:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1532142845.12.0.56676864532.issue34136@psf.upfronthosting.co.za>
In-reply-to
Content
(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.
History
Date User Action Args
2018-07-21 03:14:05gvanrossumsetrecipients: + gvanrossum, terry.reedy, kayhayen, Mark.Shannon, serhiy.storchaka, levkivskyi
2018-07-21 03:14:05gvanrossumsetmessageid: <1532142845.12.0.56676864532.issue34136@psf.upfronthosting.co.za>
2018-07-21 03:14:05gvanrossumlinkissue34136 messages
2018-07-21 03:14:04gvanrossumcreate