enumerific 1.0.4__tar.gz → 1.0.5__tar.gz

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.
Files changed (23) hide show
  1. {enumerific-1.0.4/source/enumerific.egg-info → enumerific-1.0.5}/PKG-INFO +1 -1
  2. {enumerific-1.0.4 → enumerific-1.0.5}/source/enumerific/extensible.py +8 -4
  3. enumerific-1.0.5/source/enumerific/version.txt +1 -0
  4. {enumerific-1.0.4 → enumerific-1.0.5/source/enumerific.egg-info}/PKG-INFO +1 -1
  5. enumerific-1.0.4/source/enumerific/version.txt +0 -1
  6. {enumerific-1.0.4 → enumerific-1.0.5}/LICENSE.md +0 -0
  7. {enumerific-1.0.4 → enumerific-1.0.5}/README.md +0 -0
  8. {enumerific-1.0.4 → enumerific-1.0.5}/pyproject.toml +0 -0
  9. {enumerific-1.0.4 → enumerific-1.0.5}/requirements.development.txt +0 -0
  10. {enumerific-1.0.4 → enumerific-1.0.5}/requirements.distribution.txt +0 -0
  11. {enumerific-1.0.4 → enumerific-1.0.5}/requirements.txt +0 -0
  12. {enumerific-1.0.4 → enumerific-1.0.5}/setup.cfg +0 -0
  13. {enumerific-1.0.4 → enumerific-1.0.5}/source/enumerific/__init__.py +0 -0
  14. {enumerific-1.0.4 → enumerific-1.0.5}/source/enumerific/exceptions.py +0 -0
  15. {enumerific-1.0.4 → enumerific-1.0.5}/source/enumerific/logging.py +0 -0
  16. {enumerific-1.0.4 → enumerific-1.0.5}/source/enumerific/standard.py +0 -0
  17. {enumerific-1.0.4 → enumerific-1.0.5}/source/enumerific.egg-info/SOURCES.txt +0 -0
  18. {enumerific-1.0.4 → enumerific-1.0.5}/source/enumerific.egg-info/dependency_links.txt +0 -0
  19. {enumerific-1.0.4 → enumerific-1.0.5}/source/enumerific.egg-info/requires.txt +0 -0
  20. {enumerific-1.0.4 → enumerific-1.0.5}/source/enumerific.egg-info/top_level.txt +0 -0
  21. {enumerific-1.0.4 → enumerific-1.0.5}/source/enumerific.egg-info/zip-safe +0 -0
  22. {enumerific-1.0.4 → enumerific-1.0.5}/tests/test_enumerific_library.py +0 -0
  23. {enumerific-1.0.4 → enumerific-1.0.5}/tests/test_extensible_enums.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: enumerific
3
- Version: 1.0.4
3
+ Version: 1.0.5
4
4
  Summary: Simplifies working with Python enums.
5
5
  Author: Daniel Sissman
6
6
  License-Expression: MIT
@@ -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
- pass
1654
+ self._annotations = anno(value=self.value)
1655
1655
  elif isinstance(annotations, anno):
1656
1656
  self._annotations = annotations
1657
1657
  else:
@@ -1704,8 +1704,6 @@ 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._annotations and name in self._annotations:
1708
- return self._annotations[name]
1709
1707
  elif self._context and name in dir(self._context):
1710
1708
  # Handle class methods, instance methods and properties here; because we are
1711
1709
  # performing some special handling for enumerations, we need to reintroduce
@@ -1719,6 +1717,8 @@ class Enumeration(metaclass=EnumerationMetaClass):
1719
1717
  return attribute.__get__(self)
1720
1718
  else:
1721
1719
  return attribute
1720
+ elif self._annotations and name in self._annotations:
1721
+ return self._annotations[name]
1722
1722
  else:
1723
1723
  # EnumerationOptionError subclasses AttributeError so we adhere to convention
1724
1724
  raise EnumerationOptionError(
@@ -1753,6 +1753,10 @@ class Enumeration(metaclass=EnumerationMetaClass):
1753
1753
  def value(self) -> object:
1754
1754
  return self._value
1755
1755
 
1756
+ @property
1757
+ def annotations(self) -> anno:
1758
+ return self._annotations
1759
+
1756
1760
  @property
1757
1761
  def aliased(self) -> bool:
1758
1762
  logger.debug(
@@ -0,0 +1 @@
1
+ 1.0.5
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: enumerific
3
- Version: 1.0.4
3
+ Version: 1.0.5
4
4
  Summary: Simplifies working with Python enums.
5
5
  Author: Daniel Sissman
6
6
  License-Expression: MIT
@@ -1 +0,0 @@
1
- 1.0.4
File without changes
File without changes
File without changes
File without changes
File without changes