From dfe81cc66fc599cecf30b7416f9c19cd048112d8 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 16 May 2011 20:14:10 +0000 Subject: [PATCH] minor yielding --- lib/core/common.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index a3031add1..182daf33c 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -2016,16 +2016,12 @@ def getPublicTypeMembers(type_, onlyValues=False): Useful for getting members from types (e.g. in enums) """ - retVal = [] - for name, value in inspect.getmembers(type_): if not name.startswith('__'): if not onlyValues: - retVal.append((name, value)) + yield (name, value) else: - retVal.append(value) - - return retVal + yield value def enumValueToNameLookup(type_, value_): """