FunctionProperty

class ipkiss3.all.FunctionProperty
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