T
Thomas Heller
trying out the enum34 module.
What I want to create is a subclass of enum.Enum that is also
based on ctypes.c_int so that I can better use enum instances
in ctypes api calls.
When I do this, I get a metaclass conflict:
.... FOOBAR = 0
....
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
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
When I do this, it does not work either:
.... pass
........ FOOBAR = 42
.... __metaclass__ = MyEnum_meta
....
It should have printed '<MyEnum.FOOBAR: 42>'.
Any ideas?
Thanks,
Thomas
What I want to create is a subclass of enum.Enum that is also
based on ctypes.c_int so that I can better use enum instances
in ctypes api calls.
When I do this, I get a metaclass conflict:
.... FOOBAR = 0
....
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
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
When I do this, it does not work either:
.... pass
........ FOOBAR = 42
.... __metaclass__ = MyEnum_meta
....
It should have printed '<MyEnum.FOOBAR: 42>'.
Any ideas?
Thanks,
Thomas