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 brett.cannon
Recipients brett.cannon, eric.snow
Date 2018-04-13.21:48:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
If you look at you will notice there are a lot of attributes on modules. But since the introduction of module specs (, all of those attributes became redundant.

Now some attributes can never be taken away based on common idioms in the Python community. __name__ can't go due to `if __name__ == '__main__'`. __path__ can't go due to people manipulating it with e.g. pkg_resources or pkgutil. The rest, though, don't have such strong idioms tied to them (and in the case of __package__, has actually been made officially redundant by the import system since Python 3.6). That means setting them is unnecessary and any time someone wants to read or potentially manipulate them they have to choose between those attributes or the spec (or update both). Either way it can lead to bugs (I know I have nearly forgotten to set both the spec and the attribute before).

I don't know if we can easily deprecate these attributes using __getattr__ on modules as added in Python 3.7, or if this is more of a documentation thing and need a long period of clearly messaging that these redundant attributes will no longer be set at some point.
Date User Action Args
2018-04-13 21:48:22brett.cannonsetrecipients: + brett.cannon, eric.snow
2018-04-13 21:48:22brett.cannonsetmessageid: <>
2018-04-13 21:48:22brett.cannonlinkissue33277 messages
2018-04-13 21:48:21brett.cannoncreate