Ivan Levkivskyi <levkivs...@gmail.com> added the comment:
(Sorry for typos, fixed now.) > Maybe any upcoming python version could store this information in __local__ ? > So maybe we could clone this ticket to the python core in order to address > this? I would say it is a too big change, and it is unlikely to happen only for the reason like this issue. > Why is the own class not always inside the __globals__ list of the methods? > Is there a reason? Or is this just a missing feature of the python-core? Because this is a reference to the actual module global namespace. If the class is defined inside another function, it is not in the module namespace. You can probably use the metaclass workaround, but note that it will actually modify the module globals (since __globals__ is not a copy). ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue37835> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com