From 7f65f9ecb1ce5a0e1c1acdaf40526eb8d1a8bde5 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Fri, 11 Feb 2022 11:55:47 +0100 Subject: [PATCH] Add _ALL superclass for Enumeration subclasses, for @extend purposes --- implementations/python/preserves/schema.py | 3 ++- implementations/python/setup.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/implementations/python/preserves/schema.py b/implementations/python/preserves/schema.py index 73b0b4b..ebfd2e4 100644 --- a/implementations/python/preserves/schema.py +++ b/implementations/python/preserves/schema.py @@ -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) diff --git a/implementations/python/setup.py b/implementations/python/setup.py index 767b0ae..ab67770 100644 --- a/implementations/python/setup.py +++ b/implementations/python/setup.py @@ -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",