Skip to content

Commit

Permalink
Merge pull request #32 from adepue/master
Browse files Browse the repository at this point in the history
__iter__ and __len__ should use members() which is a class method and ca...
  • Loading branch information
Adam DePue committed May 2, 2014
2 parents 5b63d8e + 7d13abd commit fd7c4d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setup(
name='richenum',
version='1.0.4',
version='1.0.5',
description='Enum library for python.',
long_description=(
open('README.rst').read() + '\n\n' +
Expand Down
4 changes: 2 additions & 2 deletions src/richenum/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,11 @@ def _setup_members(cls_attrs, cls_parents, member_cls):

class _BaseRichEnumMetaclass(type):
def __iter__(cls):
for item in cls._MEMBERS:
for item in cls.members():
yield item

def __len__(cls):
return len(cls._MEMBERS)
return len(cls.members())

def __contains__(cls, item):
# Check membership without comparing enum values to other types.
Expand Down

0 comments on commit fd7c4d2

Please sign in to comment.