Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

six.add_metaclass does not preserve __qualname__ for nested classes #259

Closed
embray opened this issue Sep 20, 2018 · 0 comments
Closed

six.add_metaclass does not preserve __qualname__ for nested classes #259

embray opened this issue Sep 20, 2018 · 0 comments

Comments

@embray
Copy link
Contributor

embray commented Sep 20, 2018

Using six.add_metaclass on a nested class loses the original class's __qualname__ on Python 3:

>>> from six import add_metaclass
>>> class A:
...     class B:
...         pass
...
>>> A.B
<class '__main__.A.B'>
>>> class MyMeta(type): pass
...
>>> class A:
...     @add_metaclass(MyMeta)
...     class B:
...         pass
...
>>> A.B
<class '__main__.B'>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant