◐ Shell
clean mode source ↗

bpo-27505: Add version_added to docs for module attributes by csabella · Pull Request #5320 · python/cpython

Sorry, I missed this earlier. module.__class__ attribute exists in Python versions older than 3.5. From Python 3.4:

>>> from types import ModuleType
>>> sys.modules['argparse'].__class__
<class 'module'>
>>> sys.modules['argparse'].__class__ = ModuleType
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: __class__ assignment: only for heap types

So I think this should be changed to use versionchanged instead of versionadded and it should say that the __class__ attribute is now writable.