Pārlūkot izejas kodu

Fix _has_[gs]etter in Auto KWArgs

Need to check if f[gs]et is not None.
master
Nate Bohman pirms 4 gadiem
vecāks
revīzija
e99f6053a1
Parakstījis: Nate Bohman <natrinicle@gmail.com> GPG atslēgas ID: C10546A54ABA1CE5
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. +2
    -2
      python_utils/kwargs_init.py

+ 2
- 2
python_utils/kwargs_init.py Parādīt failu

@@ -18,14 +18,14 @@ class AutoKWArgs(object):
"""Check if property has getter."""
class_attribute = getattr(type(self), property_key, None)
if isinstance(class_attribute, property):
return class_attribute.fget is None
return class_attribute.fget is not None
return False

def _has_setter(self, property_key):
"""Check if property has setter."""
class_attribute = getattr(type(self), property_key, None)
if isinstance(class_attribute, property):
return class_attribute.fset is None
return class_attribute.fset is not None
return False

@property

Notiek ielāde…
Atcelt
Saglabāt