Skip to content

future 0.13 breaks with_metaclass(MetaClass, object) #91

Closed
@vdboor

Description

@vdboor

The following code worked in future 0.12.x, and breaks in future 0.13:

from future.builtins import object
from future.utils import with_metaclass

class MetaClass(type):
    pass

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

That's because the newobject class got a metaclass.

Traceback:

Traceback (most recent call last):
  File "foo.py", line 7, in <module>
    class TestClass(with_metaclass(MetaClass, object)):
  File "env/lib/python2.7/site-packages/future/utils/__init__.py", line 133, 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions