PythonCharmers/python-future

metaclass conflict with newstr

Open

#392 geöffnet am 16. Okt. 2018

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Python (327 Forks)batch import
0.20help wanted

Repository-Metriken

Stars
 (1.172 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

Same issue as #91 except with newstr

from future.builtins import str
from future.utils import with_metaclass

class MetaClass(type):
    pass

class TestClass(with_metaclass(MetaClass, str)):
    pass

output:

Traceback (most recent call last):
  File "foo.py", line 7, in <module>
    class TestClass(with_metaclass(MetaClass, str)):
  File "/usr/local/lib/python2.7/site-packages/future/utils/__init__.py", line 137, in __new__
    return meta(name, bases, d)
TypeError: Error when calling the metaclass bases
    metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases

Contributor Guide