commit f6efd96b89fe55292dd5470ec35dd5263e4d3803
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 11 Jun 2023 12:34:40 +0000 (13:34 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 22 Dec 2023 19:26:19 +0000 (19:26 +0000)
Author: Luke Kenneth Casson Leighton <lkcl@lkcl.net>
Date:   Sun Jun 11 00:08:19 2023 +0100

    reduce down one more line in walkmethod.__get__

src/openpower/insndb/core.py

index d77b2f0d336b36328aa39c75a6afdd1abe48004e..3d539e06ae2ea8a40b4265ff3690a5efa3d3b591 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)