MCPcopy Index your code
hub / github.com/fluentpython/example-code-2e / local_property

Function local_property

21-async/mojifinder/bottle.py:1665–1674  ·  view source on GitHub ↗
(name=None)

Source from the content-addressed store, hash-verified

1663
1664
1665def local_property(name=None):
1666 if name: depr('local_property() is deprecated and will be removed.') #0.12
1667 ls = threading.local()
1668 def fget(self):
1669 try: return ls.var
1670 except AttributeError:
1671 raise RuntimeError("Request context not initialized.")
1672 def fset(self, value): ls.var = value
1673 def fdel(self): del ls.var
1674 return property(fget, fset, fdel, 'Thread-local property')
1675
1676
1677class LocalRequest(BaseRequest):

Callers 2

LocalRequestClass · 0.85
LocalResponseClass · 0.85

Calls 1

deprFunction · 0.85

Tested by

no test coverage detected