Skip to content

Commit 8e397ad

Browse files
committed
closes #41 change enum_properties attribute to _properties_
1 parent b9f03fc commit 8e397ad

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

enum_properties/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ class MyEnum(SymmetricMixin, enum.Enum, metaclass=EnumPropertiesMeta):
277277

278278
# members reserved for use by EnumProperties
279279
RESERVED = [
280-
'enum_properties',
280+
'_properties_',
281281
'_ep_coerce_types_',
282282
'_ep_symmetric_map_',
283283
'_ep_isymmetric_map_'
@@ -433,7 +433,7 @@ def __new__( # pylint: disable=W0221
433433
cls._ep_coerce_types_ = []
434434
cls._ep_symmetric_map_ = cls._member_map_
435435
cls._ep_isymmetric_map_ = {}
436-
cls.enum_properties = list(classdict._ep_properties_.keys())
436+
cls._properties_ = list(classdict._ep_properties_.keys())
437437

438438
for val in cls:
439439
for member_name, specialization in classdict._specialized_.get(
@@ -478,7 +478,7 @@ def add_coerce_type(typ):
478478

479479
# we reverse to maintain precedence order for symmetric lookups
480480
for prop in reversed([
481-
prop for prop in cls.enum_properties if prop.symmetric
481+
prop for prop in cls._properties_ if prop.symmetric
482482
]):
483483
for idx, val in enumerate(
484484
reversed(classdict._ep_properties_[prop])

enum_properties/tests/tests.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,12 @@ class Color(
205205
BLUE = 3, 'Azul', (0, 0, 1), '0000ff'
206206

207207
self.assertEqual(
208-
[prop for prop in Color.enum_properties if prop.symmetric],
208+
[prop for prop in Color._properties_ if prop.symmetric],
209209
['rgb', 'hex']
210210
)
211211

212212
self.assertEqual(
213-
Color.enum_properties,
213+
Color._properties_,
214214
['spanish', 'rgb', 'hex']
215215
)
216216

@@ -809,13 +809,13 @@ def test_properties_conflict(self):
809809
""" enum_properties is reserved - test that we get an exception """
810810

811811
with self.assertRaises(ValueError):
812-
class PropConflict(EnumProperties, p('enum_properties')):
812+
class PropConflict(EnumProperties, p('_properties_')):
813813
ONE = auto(), (1, 2, 3) # pragma: no cover
814814
TWO = auto(), (3, 4, 5) # pragma: no cover
815815

816816
with self.assertRaises(ValueError):
817817
class PropConflict(EnumProperties, p('prop')):
818-
enum_properties = None
818+
_properties_ = None
819819

820820
ONE = auto(), (1, 2, 3) # pragma: no cover
821821
TWO = auto(), (3, 4, 5) # pragma: no cover

0 commit comments

Comments
 (0)