mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 04:34:28 +08:00
Add _threading_local.local.__delattr__ back to the stub (#8526)
This commit is contained in:
@@ -21,6 +21,7 @@ extra_standard_library = [
|
||||
"_heapq",
|
||||
"_markupbase",
|
||||
"_random",
|
||||
"_threading_local",
|
||||
"_tkinter",
|
||||
"_tracemalloc",
|
||||
"_warnings",
|
||||
|
||||
@@ -14,3 +14,4 @@ class _localimpl:
|
||||
class local:
|
||||
def __getattribute__(self, name: str) -> Any: ...
|
||||
def __setattr__(self, name: str, value: Any) -> None: ...
|
||||
def __delattr__(self, name: str) -> None: ...
|
||||
|
||||
12
test_cases/stdlib/test_threading.py
Normal file
12
test_cases/stdlib/test_threading.py
Normal file
@@ -0,0 +1,12 @@
|
||||
import _threading_local
|
||||
import threading
|
||||
|
||||
loc = threading.local()
|
||||
loc.foo = 42
|
||||
del loc.foo
|
||||
loc.baz = ["spam", "eggs"]
|
||||
del loc.baz
|
||||
|
||||
l2 = _threading_local.local()
|
||||
l2.asdfasdf = 56
|
||||
del l2.asdfasdf
|
||||
Reference in New Issue
Block a user