Skip to content

Conversation

@elazarg
Copy link
Contributor

@elazarg elazarg commented Sep 10, 2017

Ad-hoc fix python/mypy#2824, avoiding #1595.

Quoting the comment:

This is a temporary workaround to allow multiple creation of enums with builtins such as str as mixins, which due to the handling of ABCs of builtin types, cause spurious inconsistent metaclass structure.

This workaround is relatively harmless since enums are never subclassed further. It "adds" an incorrect register method to enums and Enum, and may cause incorrect isinstance checks, but I think it will be much less common and therefore less serious than the current problems.

Avoid inconsistent metaclass structure for enum mixins due to python#1595 - e.g. mypy/python#2824
@JelleZijlstra JelleZijlstra merged commit d4b21ef into python:master Sep 11, 2017
@JelleZijlstra
Copy link
Member

Thanks for diagnosing the issue and providing a workaround!

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

Successfully merging this pull request may close these issues.

Metaclass is not properly inherited when using multiple inheritance with int

2 participants