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