From e97ef09bd35c47a849eea24c4b1a89a33bfbdf4f Mon Sep 17 00:00:00 2001 From: Jake Moshenko Date: Thu, 20 Apr 2017 13:42:49 -0400 Subject: [PATCH] Make the nooper impl even smaller! --- util/abchelpers.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/util/abchelpers.py b/util/abchelpers.py index 8908538a2..b1ba0b0f5 100644 --- a/util/abchelpers.py +++ b/util/abchelpers.py @@ -7,12 +7,11 @@ def nooper(cls): """ Decorates a class that derives from an ABCMeta, filling in any unimplemented methods with no-ops. """ - def empty_func(self_or_cls, *args, **kwargs): + def empty_func(*args, **kwargs): + # pylint: disable=unused-argument pass - empty_methods = {} - for method in cls.__abstractmethods__: - empty_methods[method] = empty_func + empty_methods = {m_name: empty_func for m_name in cls.__abstractmethods__} if not empty_methods: raise NoopIsANoopException('nooper implemented no abstract methods on %s' % cls)