Skip to content

Commit 09ce903

Browse files
committed
Merge upstream main into python315
2 parents 3c10c06 + 29bffca commit 09ce903

13 files changed

Lines changed: 79 additions & 60 deletions

File tree

CONTRIBUTING.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -366,10 +366,6 @@ Features from the `typing` module that are not present in all
366366
supported Python versions must be imported from `typing_extensions`
367367
instead in typeshed stubs. This currently affects:
368368

369-
- `TypeAlias` (new in Python 3.10)
370-
- `Concatenate` (new in Python 3.10)
371-
- `ParamSpec` (new in Python 3.10)
372-
- `TypeGuard` (new in Python 3.10)
373369
- `Self` (new in Python 3.11)
374370
- `Never` (new in Python 3.11)
375371
- `LiteralString` (new in Python 3.11)

stdlib/tkinter/__init__.pyi

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ from typing import (
1212
Generic,
1313
Literal,
1414
NamedTuple,
15+
ParamSpec,
1516
Protocol,
1617
TypeAlias,
1718
TypedDict,
@@ -379,6 +380,7 @@ getdouble = float
379380
def getboolean(s) -> bool: ...
380381

381382
_Ts = TypeVarTuple("_Ts")
383+
_P = ParamSpec("_P")
382384

383385
@type_check_only
384386
class _GridIndexInfo(TypedDict, total=False):
@@ -418,11 +420,19 @@ class Misc:
418420
def tk_focusFollowsMouse(self) -> None: ...
419421
def tk_focusNext(self) -> Misc | None: ...
420422
def tk_focusPrev(self) -> Misc | None: ...
421-
# .after() can be called without the "func" argument, but it is basically never what you want.
422-
# It behaves like time.sleep() and freezes the GUI app.
423-
def after(self, ms: int | Literal["idle"], func: Callable[[Unpack[_Ts]], object], *args: Unpack[_Ts]) -> str: ...
424-
# after_idle is essentially partialmethod(after, "idle")
425-
def after_idle(self, func: Callable[[Unpack[_Ts]], object], *args: Unpack[_Ts]) -> str: ...
423+
if sys.version_info >= (3, 14):
424+
# .after() can be called without the "func" argument, but it is basically never what you want.
425+
# It behaves like time.sleep() and freezes the GUI app.
426+
def after(self, ms: int | Literal["idle"], func: Callable[_P, object], *args: _P.args, **kwargs: _P.kwargs) -> str: ...
427+
# after_idle is essentially partialmethod(after, "idle")
428+
def after_idle(self, func: Callable[_P, object], *args: _P.args, **kwargs: _P.kwargs) -> str: ...
429+
else:
430+
# .after() can be called without the "func" argument, but it is basically never what you want.
431+
# It behaves like time.sleep() and freezes the GUI app.
432+
def after(self, ms: int | Literal["idle"], func: Callable[[Unpack[_Ts]], object], *args: Unpack[_Ts]) -> str: ...
433+
# after_idle is essentially partialmethod(after, "idle")
434+
def after_idle(self, func: Callable[[Unpack[_Ts]], object], *args: Unpack[_Ts]) -> str: ...
435+
426436
def after_cancel(self, id: str) -> None: ...
427437
if sys.version_info >= (3, 13):
428438
def after_info(self, id: str | None = None) -> tuple[str, ...]: ...
@@ -3791,16 +3801,27 @@ class _setit:
37913801
# manual page: tk_optionMenu
37923802
class OptionMenu(Menubutton):
37933803
menuname: Incomplete
3794-
def __init__(
3795-
# differs from other widgets
3796-
self,
3797-
master: Misc | None,
3798-
variable: StringVar,
3799-
value: str,
3800-
*values: str,
3801-
# kwarg only from now on
3802-
command: Callable[[StringVar], object] | None = ...,
3803-
) -> None: ...
3804+
if sys.version_info >= (3, 14):
3805+
def __init__(
3806+
# differs from other widgets
3807+
self,
3808+
master: Misc | None,
3809+
variable: StringVar,
3810+
value: str,
3811+
*values: str,
3812+
command: Callable[[StringVar], object] | None = ...,
3813+
name: str | None = None,
3814+
) -> None: ...
3815+
else:
3816+
def __init__(
3817+
# differs from other widgets
3818+
self,
3819+
master: Misc | None,
3820+
variable: StringVar,
3821+
value: str,
3822+
*values: str,
3823+
command: Callable[[StringVar], object] | None = ...,
3824+
) -> None: ...
38043825
# configure, config, cget are inherited from Menubutton
38053826
# destroy and __getitem__ are overridden, signature does not change
38063827

stdlib/tkinter/ttk.pyi

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,17 +1341,31 @@ class LabeledScale(Frame):
13411341
value: Any
13421342

13431343
class OptionMenu(Menubutton):
1344-
def __init__(
1345-
self,
1346-
master: tkinter.Misc | None,
1347-
variable: tkinter.StringVar,
1348-
default: str | None = None,
1349-
*values: str,
1350-
# rest of these are keyword-only because *args syntax used above
1351-
style: str = "",
1352-
direction: Literal["above", "below", "left", "right", "flush"] = "below",
1353-
command: Callable[[tkinter.StringVar], object] | None = None,
1354-
) -> None: ...
1344+
if sys.version_info >= (3, 14):
1345+
def __init__(
1346+
self,
1347+
master: tkinter.Misc | None,
1348+
variable: tkinter.StringVar,
1349+
default: str | None = None,
1350+
*values: str,
1351+
# rest of these are keyword-only because *args syntax used above
1352+
style: str = "",
1353+
direction: Literal["above", "below", "left", "right", "flush"] = "below",
1354+
command: Callable[[tkinter.StringVar], object] | None = None,
1355+
name: str | None = None,
1356+
) -> None: ...
1357+
else:
1358+
def __init__(
1359+
self,
1360+
master: tkinter.Misc | None,
1361+
variable: tkinter.StringVar,
1362+
default: str | None = None,
1363+
*values: str,
1364+
# rest of these are keyword-only because *args syntax used above
1365+
style: str = "",
1366+
direction: Literal["above", "below", "left", "right", "flush"] = "below",
1367+
command: Callable[[tkinter.StringVar], object] | None = None,
1368+
) -> None: ...
13551369
# configure, config, cget, destroy are inherited from Menubutton
13561370
# destroy and __setitem__ are overridden, signature does not change
13571371
def set_menu(self, default: str | None = None, *values: str) -> None: ...

stdlib/typing.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,6 +1193,7 @@ if sys.version_info >= (3, 12):
11931193
def __or__(self, right: Any, /) -> _SpecialForm: ...
11941194
def __ror__(self, left: Any, /) -> _SpecialForm: ...
11951195
if sys.version_info >= (3, 14):
1196+
def __iter__(self) -> Any: ... # Unpack[Self]
11961197
@property
11971198
def evaluate_value(self) -> EvaluateFunc: ...
11981199

stubs/gunicorn/METADATA.toml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1-
version = "25.3.0"
1+
version = "26.0.0"
22
upstream-repository = "https://github.com/benoitc/gunicorn"
33
dependencies = ["types-gevent"]
44

55
[tool.stubtest]
66
supported-platforms = ["linux", "darwin"]
77
ci-platforms = ["linux", "darwin"]
8-
stubtest-dependencies = ["gevent>=1.4.0", "eventlet>=0.24.1,!=0.36.0", "tornado>=0.2", "setproctitle", "PasteDeploy", "inotify"]
8+
stubtest-dependencies = [
9+
"gevent>=1.4.0",
10+
"eventlet>=0.24.1,!=0.36.0",
11+
"tornado>=0.2",
12+
"setproctitle",
13+
"PasteDeploy",
14+
"inotify",
15+
]

stubs/gunicorn/gunicorn/asgi/parser.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class InvalidProxyLine(ParseError): ...
1010
class InvalidProxyHeader(ParseError): ...
1111

1212
PP_V2_SIGNATURE: Final[bytes]
13+
RFC9110_6_5_1_FORBIDDEN_TRAILER: Final[frozenset[bytes]]
1314

1415
class PPCommand(IntEnum):
1516
LOCAL = 0x0

stubs/gunicorn/gunicorn/asgi/protocol.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class _BodyReceieverReceiveReturnType(TypedDict):
3838
more_body: NotRequired[bool]
3939

4040
class BodyReceiver:
41-
__slots__ = ("_chunks", "_complete", "_body_finished", "_closed", "_waiter", "request", "protocol")
41+
__slots__ = ("_chunks", "_complete", "_body_finished", "_closed", "_body_wait_expired", "_waiter", "request", "protocol")
4242
request: CallbackRequest
4343
protocol: ASGIProtocol
4444

stubs/gunicorn/gunicorn/http/message.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ TOKEN_RE: Final[re.Pattern[str]]
3434
METHOD_BADCHAR_RE: Final[re.Pattern[str]]
3535
VERSION_RE: Final[re.Pattern[str]]
3636
RFC9110_5_5_INVALID_AND_DANGEROUS: Final[re.Pattern[str]]
37+
RFC9110_6_5_1_FORBIDDEN_TRAILER: Final[frozenset[str]]
3738

3839
class Message:
3940
cfg: Config

stubs/gunicorn/gunicorn/http/parser.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Parser:
1919

2020
def __init__(self, cfg: Config, source: socket.socket | Iterable[bytes], source_addr: _AddressType) -> None: ...
2121
def __iter__(self) -> Iterator[Request]: ...
22-
def finish_body(self) -> None: ...
22+
def finish_body(self, deadline: float | None = None, max_bytes: int | None = None) -> None: ...
2323
def __next__(self) -> Request: ...
2424

2525
next: Callable[[Parser], Request]

stubs/gunicorn/gunicorn/util.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def parse_address(netloc: str, default_port: str = "8000") -> _AddressType: ...
2727
def close_on_exec(fd: FileDescriptorLike) -> None: ...
2828
def set_non_blocking(fd: FileDescriptorLike) -> None: ...
2929
def close(sock: socket) -> None: ...
30+
def close_graceful(sock: socket, timeout: float = 2.0, max_drain: int = 65536) -> None: ...
3031
def write_chunk(sock: socket, data: bytes) -> None: ...
3132
def write(sock: socket, data: bytes, chunked: bool = False) -> None: ...
3233
def write_nonblock(sock: socket, data: bytes, chunked: bool = False) -> None: ...

0 commit comments

Comments
 (0)