Functools
Module: pyot.utils.functools
class async_cached_property
async_cached_propertyAsync equivalent of
functools.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_property async def b(self): ... a = A() await a.b
Extends:
pyot.utils.functools.async_propertyGeneric
Definitions:
__init__->Nonefunc:Callable[..., Awaitable[~R]]name:None
Methods:
asyncmethod
proxy->Awaitable[~R]instance:Any
class async_generator_property
async_generator_propertyModified version of
async_property, intended for use in async generators. The return typing of the decorated property is: AsyncGenerator[...]Usage:
class A: @async_generator_property async def b(self): yield ... a = A() async for _ in a.b: ...
Extends:
pyot.utils.functools.async_propertyGeneric
Definitions:
__get__->Awaitable[~R]instance:Nonecls:None
__init__->Nonefunc:Callable[..., AsyncGenerator[~IY, ~IS]]name:None
__set__->Noneobj:Nonevalue:None
Methods:
method
proxy->Awaitable[~R]instance:Any
class async_property
async_propertyAsync equivalent of
property, takes an async method and converts it to a property that returns an awaitable with the return value.Usage:
class A: @async_property async def b(self): ... a = A() await a.b
Extends:
Generic
Definitions:
__get__->Awaitable[~R]instance:Nonecls:None
__init__->Nonefunc:Callable[..., Awaitable[~R]]name:None
__set__->Noneobj:Nonevalue:None
__set_name__->Noneowner:Nonename:None
Methods:
classmethod
func->Anyinstance:Any
asyncmethod
proxy->Awaitable[~R]instance:Any
function cached_property -> ~R
cached_property -> ~Rfunc:Callable[..., ~R]
Last updated