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 sobolevn
Recipients ethan.furman, sobolevn
Date 2022-01-17.18:50:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1642445416.0.0.633681302666.issue46418@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2022-01-17 18:50:16sobolevnsetrecipients: + sobolevn, ethan.furman
2022-01-17 18:50:15sobolevnsetmessageid: <1642445416.0.0.633681302666.issue46418@roundup.psfhosted.org>
2022-01-17 18:50:15sobolevnlinkissue46418 messages
2022-01-17 18:50:15sobolevncreate