From: Cefn Hoile Date: Mon, 19 Feb 2018 14:02:22 +0000 (+0000) Subject: Moved temporary methods to end of definition X-Git-Tag: 0.1.0~4^2~85 X-Git-Url: https://git.ayoreis.com/Adafruit_Blinka-hackapet.git/commitdiff_plain/d718837dec2d148bc6177bc67efd9eb2a5d62cea Moved temporary methods to end of definition --- diff --git a/python/mcp/__init__.py b/python/mcp/__init__.py index a8c4a84..799f336 100644 --- a/python/mcp/__init__.py +++ b/python/mcp/__init__.py @@ -6,18 +6,6 @@ class Enum(object): as seen with Direction.OUTPUT, Pull.UP """ - @classmethod - def iteritems(cls): - """ - Inspects attributes of the class for instances of the class - and returns as key,value pairs mirroring dict#iteritems - """ - for key in dir(cls): - val = getattr(cls, key) - if type(val) is cls: - yield (key, val) - - def __repr__(self): """ Assumes instance will be found as attribute of own class. @@ -30,6 +18,18 @@ class Enum(object): return "{}.{}.{}".format(cls.__module__, cls.__qualname__, key) return repr(self) + @classmethod + def iteritems(cls): + """ + Inspects attributes of the class for instances of the class + and returns as key,value pairs mirroring dict#iteritems + """ + for key in dir(cls): + val = getattr(cls, key) + if type(val) is cls: + yield (key, val) + + class Pin(Enum): def __init__(self, id): """ id type is likely platform-specific"""