Skip to content

Commit 98e76ea

Browse files
committed
fix enum for traitlets 5
1 parent 518e124 commit 98e76ea

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

js/scripts/templates/py_enums.mustache

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ class EnumNamespace:
1515
def __contains__(self, key):
1616
return key in self.__dict__
1717

18+
def __iter__(self):
19+
yield from filter(lambda e: not e.startswith('_'), dir(self))
20+
1821
def __repr__(self):
1922
return str(list(filter(lambda e: not e.startswith('_'), dir(self))))
2023

pythreejs/enums.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ def __init__(self, **kwargs):
1515
def __contains__(self, key):
1616
return key in self.__dict__
1717

18+
def __iter__(self):
19+
yield from filter(lambda e: not e.startswith('_'), dir(self))
20+
1821
def __repr__(self):
1922
return str(list(filter(lambda e: not e.startswith('_'), dir(self))))
2023

0 commit comments

Comments
 (0)