FunctionProperty

class ipkiss3.all.FunctionProperty(fget, fset=None, **kwargs)
property which calls a get and set method to set the variables

Very similar to python’s built-in property If set method is not specified, then the property is considered locked and cannot be set.

Parameters
fget: callable
fset: callable, optional

The function or callable that is used to set the attribute.

doc: str, optional

A docstring explaining the meaning and purpose of the property.

Examples

class Example(StrongPropertyInitializer):

    hello = "world"

    def fget(self):
        return self.hello

    def fset(self, value):
        self.hello = value

    # The following property will be locked.
    fnprop = FunctionProperty(fget=fget)

    fnprop_set = FunctionProperty(fget=fget, fset=fset)

example = Example()

print(example.fnprop) # -> prints "world"

example.fnprop_set = "abc"
print(example.fnprop) # -> prints "abc"
fget
fset
clone()

Create a clone of this member.

get_default(cls)

returns a tuple with information about how the default for this property is defined. (default_type, default_val) - default_type one of the enum values in DEFAULT_TYPE - default_val (if present) the default value