New submission from Nikita Sobolev <m...@sobolevn.me>:
Right now `MODULE` in Lib/test/test_enum.py is defined as: ```python MODULE = ('test.test_enum', '__main__')[__name__=='__main__'] ``` I dived into history and did not find any reasoning why it should not be just `__name__`. (But, I might had missed it: the first usage of it is dated back to 2016) This came up in https://github.com/python/cpython/pull/30641 So, I think it is a good idea to simplify it like this: ```python MODULE = __name__ ``` Probably, this won't cause any more confusion in the future :) I am not going to change all `MODULE` usages to `__name__` to keep the diff as minimal as possible. ---------- components: Tests messages: 410818 nosy: ethan.furman, sobolevn priority: normal severity: normal status: open title: Simplify `MODULE` variable in `test_enum.py` type: behavior versions: Python 3.11 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue46418> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com