Add _ALL superclass for Enumeration subclasses, for @extend purposes

This commit is contained in:
Tony Garnock-Jones 2022-02-11 11:55:47 +01:00
parent 32544c544a
commit 7f65f9ecb1
2 changed files with 3 additions and 2 deletions

View File

@ -163,9 +163,10 @@ class Enumeration(SchemaObject):
cls.MODULE_PATH = module_path
cls.NAME = name
cls.VARIANTS = []
cls._ALL = pretty_subclass(Definition, module_path_str(module_path + (name,)), '_ALL')
for (n, d) in schema[0]:
n = Symbol(n)
c = pretty_subclass(Definition, module_path_str(module_path + (name,)), n.name)
c = pretty_subclass(cls._ALL, module_path_str(module_path + (name,)), n.name)
c._set_schema(rootns, module_path, name, d, n, cls)
cls.VARIANTS.append((n, c))
safesetattr(cls, n.name, c)

View File

@ -5,7 +5,7 @@ except ImportError:
setup(
name="preserves",
version="0.12.0",
version="0.13.0",
author="Tony Garnock-Jones",
author_email="tonyg@leastfixedpoint.com",
license="Apache Software License",