Functools
Module:
pyot.utils.functools
Async equivalent offunctools.cached_property
, takes an async method and converts it to a cached property that returns an awaitable with the return value.Usage:class A:@async_cached_propertyasync def b(self):...a = A()await a.b
Extends:
pyot.utils.functools.async_property
Generic
Definitions:
__init__
->None
func
:Callable[..., Awaitable[~R]]
name
:None
Methods:
- asyncmethod
proxy
->Awaitable[~R]
instance
:Any
Modified version ofasync_property
, intended for use in async generators. The return typing of the decorated property is: AsyncGenerator[...]Usage:class A:@async_generator_propertyasync def b(self):yield ...a = A()async for _ in a.b:...
Extends:
pyot.utils.functools.async_property
Generic
Definitions:
__get__
->Awaitable[~R]
instance
:None
cls
:None
__init__
->None
func
:Callable[..., AsyncGenerator[~IY, ~IS]]
name
:None
__set__
->None
obj
:None
value
:None
Methods:
- method
proxy
->Awaitable[~R]
instance
:Any
Async equivalent ofproperty
, takes an async method and converts it to a property that returns an awaitable with the return value.Usage:class A:@async_propertyasync def b(self):...a = A()await a.b
Extends:
Generic
Definitions:
__get__
->Awaitable[~R]
instance
:None
cls
:None
__init__
->None
func
:Callable[..., Awaitable[~R]]
name
:None
__set__
->None
obj
:None
value
:None
__set_name__
->None
owner
:None
name
:None
Methods:
- classmethod
func
->Any
instance
:Any
- asyncmethod
proxy
->Awaitable[~R]
instance
:Any
func
:Callable[..., ~R]
Last modified 1yr ago