Skip to content

Commit f698bb6

Browse files
authored
Fix threading.pyi issues (#12304)
1 parent 465fdaa commit f698bb6

3 files changed

Lines changed: 5 additions & 8 deletions

File tree

stdlib/@tests/stubtest_allowlists/py313.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ _ctypes.pointer
1212
_ctypes.sizeof
1313
_thread.interrupt_main
1414
_thread.lock
15-
_thread.stack_size
1615
_thread.start_joinable_thread
17-
_thread.start_new_thread
1816
_tkinter.create
1917
asyncio.AbstractEventLoop.create_server
2018
asyncio.AbstractServer.abort_clients
@@ -111,7 +109,6 @@ site.register_readline
111109
sre_compile.SRE_FLAG_TEMPLATE
112110
sre_constants.SRE_FLAG_TEMPLATE
113111
sre_parse.SRE_FLAG_TEMPLATE
114-
threading.stack_size
115112
tkinter.Misc.after_info
116113
tkinter.Misc.busy
117114
tkinter.Misc.busy_cget

stdlib/_thread.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ error = RuntimeError
1313
def _count() -> int: ...
1414
@final
1515
class LockType:
16-
def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ...
16+
def acquire(self, blocking: bool = True, timeout: float = -1) -> bool: ...
1717
def release(self) -> None: ...
1818
def locked(self) -> bool: ...
1919
def __enter__(self) -> bool: ...
@@ -22,14 +22,14 @@ class LockType:
2222
) -> None: ...
2323

2424
@overload
25-
def start_new_thread(function: Callable[[Unpack[_Ts]], object], args: tuple[Unpack[_Ts]]) -> int: ...
25+
def start_new_thread(function: Callable[[Unpack[_Ts]], object], args: tuple[Unpack[_Ts]], /) -> int: ...
2626
@overload
27-
def start_new_thread(function: Callable[..., object], args: tuple[Any, ...], kwargs: dict[str, Any]) -> int: ...
27+
def start_new_thread(function: Callable[..., object], args: tuple[Any, ...], kwargs: dict[str, Any], /) -> int: ...
2828
def interrupt_main() -> None: ...
2929
def exit() -> NoReturn: ...
3030
def allocate_lock() -> LockType: ...
3131
def get_ident() -> int: ...
32-
def stack_size(size: int = ...) -> int: ...
32+
def stack_size(size: int = 0, /) -> int: ...
3333

3434
TIMEOUT_MAX: float
3535

stdlib/threading.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ if sys.version_info >= (3, 10):
6161
def gettrace() -> TraceFunction | None: ...
6262
def getprofile() -> ProfileFunction | None: ...
6363

64-
def stack_size(size: int = ...) -> int: ...
64+
def stack_size(size: int = 0, /) -> int: ...
6565

6666
TIMEOUT_MAX: float
6767

0 commit comments

Comments
 (0)