context
temporary_class_attr(cls, attr, value)
Context method to temporarily assign a value to a class attribute.
The assigned value will only be held within the context.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cls
|
type[Any]
|
Class of which the class attribute value is to be assigned. |
required |
attr
|
str
|
Name of class attribute. |
required |
value
|
Any
|
Value to assign to class attribute (must be correct type). |
required |