reduce down one more line in walkmethod.__get__
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 10 Jun 2023 23:08:19 +0000 (00:08 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 10 Jun 2023 23:08:19 +0000 (00:08 +0100)
src/openpower/insndb/core.py

index d19f92a5622059b42710dd16089542d25855db20..973aac002776707372988360ff8dee3dcbea501c 100644 (file)
@@ -63,9 +63,7 @@ class walkmethod:
         return super().__init__()
 
     def __get__(self, instance, owner):
-        entity = instance
-        if instance is None:
-            entity = owner
+        entity = owner if instance is None else instance
         return _functools.partial(self.__walk, entity)