[issue42137] Prefer using __spec__ over module_repr() for ModuleType.__repr__

Brett Cannon report at bugs.python.org
Sat Mar 20 22:28:45 EDT 2021


Brett Cannon <brett at python.org> added the comment:

Thinking about it more, raising ImportWarning (or DeprecationWarning) is unnecessarily noisy as the existence of the module isn't problematic, it just won't be used anymore in the future. So updating the code to use __spec__ first and then document in "What's New" should be good enough.

----------
assignee:  -> brett.cannon
title: Raise an ImportWarning for calling module_repr() on loaders -> Prefer using __spec__ over module_repr() for ModuleType.__repr__

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42137>
_______________________________________


More information about the Python-bugs-list mailing list