enumerific 1.0.5__py3-none-any.whl → 1.0.6__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 CHANGED
@@ -1797,6 +1797,28 @@ class Enumeration(metaclass=EnumerationMetaClass):
1797
1797
 
1798
1798
  return aliases
1799
1799
 
1800
+ @property
1801
+ def named(self) -> list[str]:
1802
+ logger.debug(
1803
+ "%s.names() >>> id(%s) => %s (%s)",
1804
+ self.__class__.__name__,
1805
+ self,
1806
+ id(self._enumerations),
1807
+ type(self._enumerations),
1808
+ )
1809
+
1810
+ names: list[Enumeration] = [self.name]
1811
+
1812
+ for name, enumeration in self._enumerations.items():
1813
+ logger.debug(" >>> checking for alias: %s => %s", name, enumeration)
1814
+
1815
+ if isinstance(enumeration, Enumeration):
1816
+ if self is enumeration and enumeration.name != name:
1817
+ if not name in names:
1818
+ names.append(name)
1819
+
1820
+ return names
1821
+
1800
1822
 
1801
1823
  class EnumerationType(Enumeration, typecast=False):
1802
1824
  """The EnumerationType class represents the type of value held by an enumeration."""
enumerific/version.txt CHANGED
@@ -1 +1 @@
1
- 1.0.5
1
+ 1.0.6
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: enumerific
3
- Version: 1.0.5
3
+ Version: 1.0.6
4
4
  Summary: Simplifies working with Python enums.
5
5
  Author: Daniel Sissman
6
6
  License-Expression: MIT
@@ -468,6 +468,11 @@ assert Colors.BLUE.aliased is False
468
468
  assert Colors.RED.aliases == [Colors.ROUGE]
469
469
  assert Colors.GREEN.aliases == [Colors.VERTE]
470
470
  assert Colors.BLUE.aliases == [] # BLUE has not been aliased
471
+
472
+ # The names including any aliases for an option can be obtained via the .named property
473
+ assert Colors.RED.named == ["RED", "ROUGE"]
474
+ assert Colors.GREEN.named == ["GREEN", "VERTE"]
475
+ assert Colors.BLUE.named == ["BLUE"]
471
476
  ```
472
477
 
473
478
  #### Example 15: Non-Unique Options
@@ -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=9OodW6krNAd2B85QesBNUl3T5tcfsEJf_UhZ5sbNvyE,85763
4
+ enumerific/logging.py,sha256=zz1Phnot1BFWMoxwvZ0FlZDsiYZZYhz-_S4IzgPYc40,97
5
+ enumerific/standard.py,sha256=xQhhwlcYZ6-8DmgscbV38g2Ol5Z8_vvBwonz-Ww0I40,3254
6
+ enumerific/version.txt,sha256=4ct5uLutDTkkmV0uFpcf40QM4kZNWdiGBJJcDWsLbF0,5
7
+ enumerific-1.0.6.dist-info/licenses/LICENSE.md,sha256=j1XidOCGUhPx7CyXA31uC0XGKDRnvUcZpMp161qHI6g,1077
8
+ enumerific-1.0.6.dist-info/METADATA,sha256=DgcRl0DM_TlaRkBg7fIaMBl4wfKUydvjIzYsgLFJpL4,33208
9
+ enumerific-1.0.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
10
+ enumerific-1.0.6.dist-info/top_level.txt,sha256=hyemsMgPYZgSx71XHmFRF-gvc_2Y4rDAESR8e0hbYHU,11
11
+ enumerific-1.0.6.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
12
+ enumerific-1.0.6.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=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,,