decorators module¶
Class and function decorators.
cacheable function¶
Cacheable function decorator.
See notes on cacheable_property.
Note
To decorate an instance method, use cacheable_method.
cacheable_method function¶
cacheable_method(
*args,
use_cache=False,
whitelist=False,
max_size=None,
ignore_args=None,
**options
)
Cacheable method decorator.
See notes on cacheable_property.
cached function¶
cacheable with use_cache set to True.
Note
To decorate an instance method, use cached_method.
cached_method function¶
cacheable_method with use_cache set to True.
custom_function function¶
Custom function decorator.
custom_method function¶
Custom method decorator.
memoized_method function¶
Dead-simple memoization decorator for methods.
cacheable_property class¶
Extends custom_property for cacheable properties.
Note
Assumes that the instance (provided as self) won't change. If calculation depends upon object attributes that can be changed, it won't notice the change.
Superclasses
- Base
builtins.property- custom_property
Inherited members
- Base.chat
- Base.find_api
- Base.find_assets
- Base.find_docs
- Base.find_examples
- Base.find_messages
- custom_property.func
- custom_property.name
- custom_property.options
Subclasses
get_ca_setup method¶
Get setup of type CARunSetup if instance is known, or CAUnboundSetup otherwise.
See vectorbtpro.registries.ca_registry for details on the caching procedure.
init_use_cache class property¶
Initial value for use_cache.
init_whitelist class property¶
Initial value for whitelist.
cached_property class¶
cacheable_property with use_cache set to True.
Superclasses
- Base
builtins.property- cacheable_property
- custom_property
Inherited members
- Base.chat
- Base.find_api
- Base.find_assets
- Base.find_docs
- Base.find_examples
- Base.find_messages
- cacheable_property.func
- cacheable_property.get_ca_setup
- cacheable_property.init_use_cache
- cacheable_property.init_whitelist
- cacheable_property.name
- cacheable_property.options
class_property class¶
Property that can be called on a class.
Superclasses
Inherited members
func class property¶
Wrapped function.
custom_property class¶
Custom extensible property that stores function and options as attributes.
Note
custom_property instances belong to classes, not class instances. Thus changing the property will do the same for each instance of the class where the property has been defined initially.
Superclasses
- Base
builtins.property
Inherited members
Subclasses
func class property¶
Wrapped function.
name class property¶
Wrapped function name.
options class property¶
Options.
hybrid_property class¶
Property that binds self to a class if the function is called as class method, otherwise to an instance.
Superclasses
Inherited members
func class property¶
Wrapped function.