Skip to content

Commit 5b47f13

Browse files
authored
Add _threading_local.local.__delattr__ back to the stub (#8526)
1 parent 3623f92 commit 5b47f13

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ extra_standard_library = [
2121
"_heapq",
2222
"_markupbase",
2323
"_random",
24+
"_threading_local",
2425
"_tkinter",
2526
"_tracemalloc",
2627
"_warnings",

stdlib/_threading_local.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ class _localimpl:
1414
class local:
1515
def __getattribute__(self, name: str) -> Any: ...
1616
def __setattr__(self, name: str, value: Any) -> None: ...
17+
def __delattr__(self, name: str) -> None: ...

test_cases/stdlib/test_threading.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import _threading_local
2+
import threading
3+
4+
loc = threading.local()
5+
loc.foo = 42
6+
del loc.foo
7+
loc.baz = ["spam", "eggs"]
8+
del loc.baz
9+
10+
l2 = _threading_local.local()
11+
l2.asdfasdf = 56
12+
del l2.asdfasdf

0 commit comments

Comments
 (0)