Path: blob/master/ invest-robot-contest_TinkoffBotTwitch-main/venv/lib/python3.8/site-packages/aiohttp/_helpers.pyx
7763 views
cdef class reify:1"""Use as a class method decorator. It operates almost exactly like2the Python `@property` decorator, but it puts the result of the3method it decorates into the instance dict after the first call,4effectively replacing the function it decorates with an instance5variable. It is, in Python parlance, a data descriptor.67"""89cdef object wrapped10cdef object name1112def __init__(self, wrapped):13self.wrapped = wrapped14self.name = wrapped.__name__1516@property17def __doc__(self):18return self.wrapped.__doc__1920def __get__(self, inst, owner):21try:22try:23return inst._cache[self.name]24except KeyError:25val = self.wrapped(inst)26inst._cache[self.name] = val27return val28except AttributeError:29if inst is None:30return self31raise3233def __set__(self, inst, value):34raise AttributeError("reified property is read-only")353637