enumerific 1.0.3__py3-none-any.whl → 1.0.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- enumerific/extensible.py +19 -4
- enumerific/version.txt +1 -1
- {enumerific-1.0.3.dist-info → enumerific-1.0.5.dist-info}/METADATA +1 -1
- enumerific-1.0.5.dist-info/RECORD +12 -0
- enumerific-1.0.3.dist-info/RECORD +0 -12
- {enumerific-1.0.3.dist-info → enumerific-1.0.5.dist-info}/WHEEL +0 -0
- {enumerific-1.0.3.dist-info → enumerific-1.0.5.dist-info}/licenses/LICENSE.md +0 -0
- {enumerific-1.0.3.dist-info → enumerific-1.0.5.dist-info}/top_level.txt +0 -0
- {enumerific-1.0.3.dist-info → enumerific-1.0.5.dist-info}/zip-safe +0 -0
enumerific/extensible.py
CHANGED
|
@@ -1195,7 +1195,7 @@ class EnumerationMetaClass(type):
|
|
|
1195
1195
|
|
|
1196
1196
|
logger.debug("+" * 100)
|
|
1197
1197
|
|
|
1198
|
-
def __getattr__(self, name) -> object:
|
|
1198
|
+
def __getattr__(self, name: str) -> object:
|
|
1199
1199
|
# logger.debug("%s.__getattr__(name: %s)", self.__class__.__name__, name)
|
|
1200
1200
|
|
|
1201
1201
|
if name.startswith("_") or name in self._special:
|
|
@@ -1651,7 +1651,7 @@ class Enumeration(metaclass=EnumerationMetaClass):
|
|
|
1651
1651
|
)
|
|
1652
1652
|
|
|
1653
1653
|
if annotations is None:
|
|
1654
|
-
|
|
1654
|
+
self._annotations = anno(value=self.value)
|
|
1655
1655
|
elif isinstance(annotations, anno):
|
|
1656
1656
|
self._annotations = annotations
|
|
1657
1657
|
else:
|
|
@@ -1704,10 +1704,21 @@ class Enumeration(metaclass=EnumerationMetaClass):
|
|
|
1704
1704
|
return object.__getattribute__(self, name)
|
|
1705
1705
|
elif self._enumerations and name in self._enumerations:
|
|
1706
1706
|
return self._enumerations[name]
|
|
1707
|
+
elif self._context and name in dir(self._context):
|
|
1708
|
+
# Handle class methods, instance methods and properties here; because we are
|
|
1709
|
+
# performing some special handling for enumerations, we need to reintroduce
|
|
1710
|
+
# the necessary context to the methods here via the descriptor protocol so
|
|
1711
|
+
# the methods and properties work as expected:
|
|
1712
|
+
if callable(attribute := object.__getattribute__(self._context, name)):
|
|
1713
|
+
return attribute.__get__(self)
|
|
1714
|
+
elif isinstance(attribute, property):
|
|
1715
|
+
return attribute.__get__(self)
|
|
1716
|
+
elif isinstance(attribute, classmethod):
|
|
1717
|
+
return attribute.__get__(self)
|
|
1718
|
+
else:
|
|
1719
|
+
return attribute
|
|
1707
1720
|
elif self._annotations and name in self._annotations:
|
|
1708
1721
|
return self._annotations[name]
|
|
1709
|
-
elif self._context and name in dir(self._context):
|
|
1710
|
-
return object.__getattribute__(self._context, name)
|
|
1711
1722
|
else:
|
|
1712
1723
|
# EnumerationOptionError subclasses AttributeError so we adhere to convention
|
|
1713
1724
|
raise EnumerationOptionError(
|
|
@@ -1742,6 +1753,10 @@ class Enumeration(metaclass=EnumerationMetaClass):
|
|
|
1742
1753
|
def value(self) -> object:
|
|
1743
1754
|
return self._value
|
|
1744
1755
|
|
|
1756
|
+
@property
|
|
1757
|
+
def annotations(self) -> anno:
|
|
1758
|
+
return self._annotations
|
|
1759
|
+
|
|
1745
1760
|
@property
|
|
1746
1761
|
def aliased(self) -> bool:
|
|
1747
1762
|
logger.debug(
|
enumerific/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.0.5
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
enumerific/__init__.py,sha256=K9iFirgxSkrHgXfhocOvgRkskGe0VfWRgxEvppnVWBM,587
|
|
2
|
+
enumerific/exceptions.py,sha256=lvfcH1cz43hDjzSUpgm1-OZjKzxo--fyZ8UsBS-GiZA,359
|
|
3
|
+
enumerific/extensible.py,sha256=W-W1wXCW1wE7PP3Y2qbhxLpD2ETjmIQ-QTGnWIEGUyg,85084
|
|
4
|
+
enumerific/logging.py,sha256=zz1Phnot1BFWMoxwvZ0FlZDsiYZZYhz-_S4IzgPYc40,97
|
|
5
|
+
enumerific/standard.py,sha256=xQhhwlcYZ6-8DmgscbV38g2Ol5Z8_vvBwonz-Ww0I40,3254
|
|
6
|
+
enumerific/version.txt,sha256=nXE_EpedYoeSULwKIDXj71cxWsQlHoUBnSHHXtcmlyA,5
|
|
7
|
+
enumerific-1.0.5.dist-info/licenses/LICENSE.md,sha256=j1XidOCGUhPx7CyXA31uC0XGKDRnvUcZpMp161qHI6g,1077
|
|
8
|
+
enumerific-1.0.5.dist-info/METADATA,sha256=WDWq40qr1A3IHSTMDVOfUcCw76YCUnlEqxcRKPI4rRU,32990
|
|
9
|
+
enumerific-1.0.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
10
|
+
enumerific-1.0.5.dist-info/top_level.txt,sha256=hyemsMgPYZgSx71XHmFRF-gvc_2Y4rDAESR8e0hbYHU,11
|
|
11
|
+
enumerific-1.0.5.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
12
|
+
enumerific-1.0.5.dist-info/RECORD,,
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
enumerific/__init__.py,sha256=K9iFirgxSkrHgXfhocOvgRkskGe0VfWRgxEvppnVWBM,587
|
|
2
|
-
enumerific/exceptions.py,sha256=lvfcH1cz43hDjzSUpgm1-OZjKzxo--fyZ8UsBS-GiZA,359
|
|
3
|
-
enumerific/extensible.py,sha256=AS9rU-luPjfau_PHFa52r-rlaDWpbxiF4qgnh4BdH9o,84320
|
|
4
|
-
enumerific/logging.py,sha256=zz1Phnot1BFWMoxwvZ0FlZDsiYZZYhz-_S4IzgPYc40,97
|
|
5
|
-
enumerific/standard.py,sha256=xQhhwlcYZ6-8DmgscbV38g2Ol5Z8_vvBwonz-Ww0I40,3254
|
|
6
|
-
enumerific/version.txt,sha256=INLLCW0atBpBQCRtEvB79rjLdD_UgSK3JTLAPUTFwUo,5
|
|
7
|
-
enumerific-1.0.3.dist-info/licenses/LICENSE.md,sha256=j1XidOCGUhPx7CyXA31uC0XGKDRnvUcZpMp161qHI6g,1077
|
|
8
|
-
enumerific-1.0.3.dist-info/METADATA,sha256=EEriXyK6TOyNDx0_juEMGnyf4h5NKP_o2JNWncNssgY,32990
|
|
9
|
-
enumerific-1.0.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
10
|
-
enumerific-1.0.3.dist-info/top_level.txt,sha256=hyemsMgPYZgSx71XHmFRF-gvc_2Y4rDAESR8e0hbYHU,11
|
|
11
|
-
enumerific-1.0.3.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
12
|
-
enumerific-1.0.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|