snakia.property.hook_property

Classes

Generic()

Abstract base class for generic types.

HookProperty(on_get[, on_set, on_del])

A property that calls a function when the property is set, get, or deleted.

PrivProperty([default_value])

TypeVar(name, *constraints[, bound, ...])

Type variable.

class snakia.property.hook_property.HookProperty(on_get, on_set=<function func>, on_del=<function func>)[source]

Bases: PrivProperty[T], Generic[T]

A property that calls a function when the property is set, get, or deleted.

__init__(on_get, on_set=<function func>, on_del=<function func>)[source]
deleter(on_del, /)[source]

Descriptor deleter.

Return type:

Self

getter(on_get, /)[source]

Descriptor getter.

Return type:

Self

property name: str

Return the name of the variable associated with the property.

setter(on_set, /)[source]

Descriptor setter.

Return type:

Self