minor yielding

This commit is contained in:
Miroslav Stampar 2011-05-16 20:14:10 +00:00
parent a5ad4621c9
commit dfe81cc66f

View File

@ -2016,16 +2016,12 @@ def getPublicTypeMembers(type_, onlyValues=False):
Useful for getting members from types (e.g. in enums) Useful for getting members from types (e.g. in enums)
""" """
retVal = []
for name, value in inspect.getmembers(type_): for name, value in inspect.getmembers(type_):
if not name.startswith('__'): if not name.startswith('__'):
if not onlyValues: if not onlyValues:
retVal.append((name, value)) yield (name, value)
else: else:
retVal.append(value) yield value
return retVal
def enumValueToNameLookup(type_, value_): def enumValueToNameLookup(type_, value_):
""" """