Skip to content

Commit f690431

Browse files
committed
#35 cache getmembers result when computing is_node_property
1 parent e297bef commit f690431

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

pylasu/model/model.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ class Concept(ABCMeta):
8585

8686
def __init__(cls, what, bases=None, dict=None):
8787
super().__init__(what, bases, dict)
88-
cls.__internal_properties__ = ["origin", "destination", "parent", "position", "position_override"]
88+
cls.__internal_properties__ = \
89+
(["origin", "destination", "parent", "position", "position_override"] +
90+
[n for n, v in inspect.getmembers(cls, is_internal_property_or_method)])
8991

9092
@property
9193
def node_properties(cls):
@@ -118,9 +120,7 @@ def _direct_node_properties(cls, cl, known_property_names):
118120
yield PropertyDescription(name, False)
119121

120122
def is_node_property(cls, name):
121-
return not name.startswith('_') \
122-
and name not in cls.__internal_properties__ \
123-
and name not in [n for n, v in inspect.getmembers(cls, is_internal_property_or_method)]
123+
return not name.startswith('_') and name not in cls.__internal_properties__
124124

125125

126126
class Node(Origin, Destination, metaclass=Concept):

0 commit comments

Comments
 (0)