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

Support six.add_metaclass #3365

Closed
gvanrossum opened this issue May 15, 2017 · 2 comments
Closed

Support six.add_metaclass #3365

gvanrossum opened this issue May 15, 2017 · 2 comments

Comments

@gvanrossum
Copy link
Member

Forked from #1764. I propose to give this less priority than six.with_metaclass, since the latter is more fundamental in some sense (it works for multiple bases with conflicting metaclasses where add_metaclass can't, see #1764 (comment)).

@gvanrossum
Copy link
Member Author

There's also the issue that mypy accepted this, which doesn't work at runtime:

@six.add_metaclass(ArcMeta)
class Arc(Generic[T_co], Destroyable):

To address this we ought to duplicate Python's metaclass compatibility check.

@elazarg
Copy link
Contributor

elazarg commented Aug 18, 2017

The consistency of the metaclass structure is already handled, once we tell mypy what add_metaclass means.

ilevkivskyi pushed a commit that referenced this issue Aug 31, 2017
Fix #3365

There are no special checks for improper use (similar to six.with_metaclass).
Consistency checks are handled like in any other metaclass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants