Add _threading_local.local.__delattr__ back to the stub (#8526)

This commit is contained in:
Alex Waygood
2022-08-15 11:56:31 +02:00
committed by GitHub
parent 3623f923a6
commit 5b47f13a99
3 changed files with 14 additions and 0 deletions

View File

@@ -21,6 +21,7 @@ extra_standard_library = [
"_heapq",
"_markupbase",
"_random",
"_threading_local",
"_tkinter",
"_tracemalloc",
"_warnings",

View File

@@ -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: ...

View 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