lisa.wlgen.rta.OverridenProperty#

class lisa.wlgen.rta.OverridenProperty(prop, deep=True)[source]#

Bases: PropertyWrapper

Forcefully override the value of another property.

See also

override()

Classes

__class__ inherited

Metaclass for properties.

Attributes

KEY

Subclasses can override this attribute so that PropertyBase.from_key() knows that it can call their _from_key() method for that key.

Properties

key inherited

Key of the instance.

val inherited

Value “payload” of the property.

Methods

__and__()

We only want to override properties “downards”, which means:.

HASH_COERCE() inherited

Used to coerce the values of self.__dict__ to hashable values.

__copy__() inherited

__getattr__() inherited

Be as transparent as possible, so that this sort of call would work: self.__prop.__and__(self).

__rand__() inherited

find_cls() inherited

Find which subclass can handle key.

from_key() inherited

Alternative constructor that is available with the same signature for all properties.

with_wrapped() inherited

Build a new instance with modified wrapped property.

Classes#

OverridenProperty.__class__#

alias of PropertyMeta

Attributes#

OverridenProperty.KEY = None#

Subclasses can override this attribute so that PropertyBase.from_key() knows that it can call their _from_key() method for that key.

Note

This class attribute will not be inherited automatically so that each class can be uniquely identified by its key. Subclass that do not override the value explicitly will get None.

Properties#

property OverridenProperty.key#

Inherited property, see lisa.wlgen.rta.PropertyBase.key

Key of the instance.

property OverridenProperty.val#

Inherited property, see lisa.wlgen.rta.PropertyWrapper.val

Value “payload” of the property.

Methods#

OverridenProperty.__and__(other)[source]#

We only want to override properties “downards”, which means:

  • OverridenProperty(root) & leaf = OverridenProperty(root)

  • root & OverridenProperty(leaf) = OverridenProperty(root & leaf)

Note

When deep=False is used, this class does not form a semigroup, i.e. the result will depend on the order of the tree traversal.

OverridenProperty.HASH_COERCE(x, coerce)#

Inherited method, see lisa.utils.SimpleHash.HASH_COERCE()

Used to coerce the values of self.__dict__ to hashable values.

OverridenProperty.__copy__()#

Inherited method, see lisa.wlgen.rta.PropertyWrapper.__copy__()

OverridenProperty.__getattr__(attr)#

Inherited method, see lisa.wlgen.rta.PropertyWrapper.__getattr__()

Be as transparent as possible, so that this sort of call would work: self.__prop.__and__(self).

OverridenProperty.__rand__(other)#

Inherited method, see lisa.wlgen.rta.PropertyWrapper.__rand__()

classmethod OverridenProperty.find_cls(key)#

Inherited method, see lisa.wlgen.rta.PropertyBase.find_cls()

Find which subclass can handle key.

classmethod OverridenProperty.from_key(key, val, **kwargs)#

Inherited method, see lisa.wlgen.rta.PropertyWrapper.from_key()

Alternative constructor that is available with the same signature for all properties.

OverridenProperty.with_wrapped(wrapped)#

Inherited method, see lisa.wlgen.rta.PropertyWrapper.with_wrapped()

Build a new instance with modified wrapped property.