diff --git a/pyproject.toml b/pyproject.toml index 24762a194..5f76ae22e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,6 +21,7 @@ extra_standard_library = [ "_heapq", "_markupbase", "_random", + "_threading_local", "_tkinter", "_tracemalloc", "_warnings", diff --git a/stdlib/_threading_local.pyi b/stdlib/_threading_local.pyi index d455ce092..98683dabc 100644 --- a/stdlib/_threading_local.pyi +++ b/stdlib/_threading_local.pyi @@ -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: ... diff --git a/test_cases/stdlib/test_threading.py b/test_cases/stdlib/test_threading.py new file mode 100644 index 000000000..9b67ac540 --- /dev/null +++ b/test_cases/stdlib/test_threading.py @@ -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