s-kostyuk / everpl

The Everthing Platfrom source code
https://everpl.readthedocs.io/
MIT License
0 stars 1 forks source link

Metaclass conflict workaround for Has Value capability #120

Closed s-kostyuk closed 6 years ago

s-kostyuk commented 6 years ago

Has Value capability was implemented as a generic class, a child of a Generic class from Python typing module. Unfortunately, Generic class is implemented using a non-trivial GenericMeta metaclass which in combination with user-declared metaclasses results in a metaclass conflict.

To workaround (but not fix) this problem it was decided to make a HasValue class usual, non-generic class. But the real fix will be possible only when PEP 560 will be supported by the current version of Python (i.e. starting from Python 3.7).

Another workaround: create a new metaclass that will inherit from GenericMeta or modify existing metaclasses to do so.

More info:

Follow-up for #117