INNER CODE UNIT · Python
__getattr__
micronaut-projects/micronaut-core · context-python/src/main/resources/META-INF/GRAALPY-VFS/micronaut-application/src/micronaut_asyncio.py:87
def __getattr__(self, name):
by_thread = object.__getattribute__(self, "_by_thread")
defaults = object.__getattribute__(self, "_defaults")
values = by_thread.get(threading.get_ident())
if values is not None and name in values:
return values[name]
if name in defaults:
return defaults[name]
raise AttributeError(name)
def __setattr__(self, name, value):
by_thread = object.__getattribute__(self, "_by_thread")
defaults = object.__getattribute__(self, "_defaults")
ident = threading.get_ident()
values = by_thread.get(ident)
if value == defaults.get(name, _UNSET):
# back to the default: the thread's entry is dropped, not kept
if values is not None: