🔷
Pyot Documentation
  • Pyot Documentation
  • Cores
    • Installation
    • Configuration
    • Objects
    • Concurrency
    • Resources
    • Exceptions
    • Warnings
  • Examples
    • Single File
    • Multi Root
    • Module Based
  • Pipeline
    • Expirations
    • Handler
    • Object
    • Token
  • Stores
    • CDragon
    • DDragon
    • DiskCache
    • DjangoCache
    • MerakiCDN
    • MongoDB
    • Omnistone
    • RedisCache
    • RiotAPI
  • Limiters
    • MemoryLimiter
    • RedisLimiter
  • Models
    • League of Legends
      • Champion
      • Championmastery
      • Championrotation
      • Clash
      • Item
      • League
      • Match
      • Merakichampion
      • Merakiitem
      • Profileicon
      • Rune
      • Spectator
      • Spell
      • Status
      • Summoner
      • Thirdpartycode
      • Tournament
    • Legends of Runeterra
      • Card
      • Match
      • Ranked
      • Status
    • Riot Services
      • Account
    • Teamfight Tactics
      • Champion
      • Item
      • League
      • Match
      • Profileicon
      • Summoner
      • Thirdpartycode
      • Trait
    • Valorant
      • Content
      • Match
      • Ranked
      • Status
  • Utils
    • LoL
      • Cdragon
      • Champion
      • Routing
    • LoR
      • Cards
    • Tft
      • Cdragon
      • Routing
    • Aiohttp
    • Copy
    • Functools
    • Importlib
    • Itertools
    • Logging
    • Nullsafe
    • Safejson
    • Sync
    • Text
    • Threading
  • Integrations
    • Django
    • FastAPI
    • Celery
  • Changelog
    • 5.x.x
    • 6.x.x
Powered by GitBook
On this page
  • class async_cached_property
  • class async_generator_property
  • class async_property
  • function cached_property -> ~R
  1. Utils

Functools

Module: pyot.utils.functools

class async_cached_property

Async 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_property

  • Generic

Definitions:

  • __init__ -> None

    • func: Callable[..., Awaitable[~R]]

    • name: None

Methods:

  • asyncmethod proxy -> Awaitable[~R]

    • instance: Any

class async_generator_property

Modified 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_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

class async_property

Async 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: 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

function cached_property -> ~R

  • func: Callable[..., ~R]

PreviousCopyNextImportlib

Last updated 2 years ago