New submission from Ivan Levkivskyi:
__module__ attribute is set differently depending on whether a metaclass is
explicitly called or invoked in a class statement:
>>> A = ABCMeta('A', (), {})
>>> A.__module__
'abc'
>>> class B(metaclass=ABCMeta): ...
...
>>> B.__module__
'__main__'
Documentation on data model says that "__module__ is the module name in which
the class was defined", so that the second behaviour seems right, while the
first behaviour seems wrong to me.
----------
components: Interpreter Core
messages: 282363
nosy: levkivskyi
priority: normal
severity: normal
status: open
title: __module__ attribute is not set correctly for a class created by direct
metaclass call
versions: Python 3.4, Python 3.5, Python 3.6
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue28869>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com