Skip to content

Commit f3db3b5

Browse files
authored
Merge branch 'main' into patch-2
2 parents e27f4e6 + da65515 commit f3db3b5

18 files changed

Lines changed: 607 additions & 356 deletions

File tree

requirements-tests.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Type checkers that we test our stubs against. These should always
22
# be pinned to a specific version to make failure reproducible.
33
mypy==2.1.0
4-
pyright==1.1.409
4+
pyright==1.1.410
55

66
# Libraries used by our various scripts.
77
aiohttp==3.13.5
@@ -18,7 +18,7 @@ termcolor>=2.3
1818
tomli==2.4.1; python_version < "3.11"
1919
tomlkit==0.14.0
2020
typing_extensions>=4.15.0rc1
21-
uv==0.11.6
21+
uv==0.11.15
2222

2323
# Utilities for typeshed infrastructure scripts.
2424
ts_utils @ file:lib

stdlib/@tests/stubtest_allowlists/common.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,11 @@ _?ctypes.Union.__getattr__ # doesn't exist, but makes things easy if we pretend
236236
_?ctypes.Union.__setattr__ # doesn't exist, but makes things easy if we pretend it does
237237

238238
# Iterable classes that don't define __iter__ at runtime (usually iterable via __getitem__)
239-
# These would ideally be special-cased by type checkers; see https://github.com/python/mypy/issues/2220
239+
# These would ideally be special-cased by type checkers.
240+
# See https://github.com/python/mypy/issues/2220 and https://github.com/python/typeshed/issues/7813
240241
_?ctypes.Array.__iter__
242+
calendar._localized_day.__iter__
243+
calendar._localized_month.__iter__
241244

242245
dataclasses.KW_ONLY # white lies around defaults
243246

stdlib/_asyncio.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class Task(Future[_T_co]): # type: ignore[type-var] # pyright: ignore[reportIn
9999
def get_event_loop() -> AbstractEventLoop: ...
100100
def get_running_loop() -> AbstractEventLoop: ...
101101
def _set_running_loop(loop: AbstractEventLoop | None, /) -> None: ...
102-
def _get_running_loop() -> AbstractEventLoop: ...
102+
def _get_running_loop() -> AbstractEventLoop | None: ...
103103
def _register_task(task: Task[Any]) -> None: ...
104104
def _unregister_task(task: Task[Any]) -> None: ...
105105
def _enter_task(loop: AbstractEventLoop, task: Task[Any]) -> None: ...

stdlib/calendar.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import datetime
22
import enum
33
import sys
44
from _typeshed import Unused
5-
from collections.abc import Iterable
5+
from collections.abc import Iterable, Iterator
66
from time import struct_time
77
from typing import ClassVar, Final, TypeAlias, overload
88

@@ -170,6 +170,7 @@ class _localized_month:
170170
def __getitem__(self, i: slice) -> list[str]: ...
171171

172172
def __len__(self) -> int: ...
173+
def __iter__(self) -> Iterator[str]: ...
173174

174175
class _localized_day:
175176
format: str
@@ -181,6 +182,7 @@ class _localized_day:
181182
def __getitem__(self, i: slice) -> list[str]: ...
182183

183184
def __len__(self) -> int: ...
185+
def __iter__(self) -> Iterator[str]: ...
184186

185187
day_name: _localized_day
186188
day_abbr: _localized_day

stdlib/multiprocessing/connection.pyi

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ class Listener:
4646
def __init__(
4747
self, address: _Address | None = None, family: str | None = None, backlog: int = 1, authkey: bytes | None = None
4848
) -> None: ...
49-
def accept(self) -> Connection[Incomplete, Incomplete]: ...
49+
if sys.platform != "win32":
50+
def accept(self) -> Connection[Incomplete, Incomplete]: ...
51+
else:
52+
def accept(self) -> Connection[Incomplete, Incomplete] | PipeConnection[Incomplete, Incomplete]: ...
53+
5054
def close(self) -> None: ...
5155
@property
5256
def address(self) -> _Address: ...
@@ -59,16 +63,23 @@ class Listener:
5963

6064
# Any: send and recv methods unused
6165
if sys.version_info >= (3, 12):
62-
def deliver_challenge(connection: Connection[Any, Any], authkey: bytes, digest_name: str = "sha256") -> None: ...
66+
def deliver_challenge(connection: _ConnectionBase[Any, Any], authkey: bytes, digest_name: str = "sha256") -> None: ...
6367

6468
else:
65-
def deliver_challenge(connection: Connection[Any, Any], authkey: bytes) -> None: ...
69+
def deliver_challenge(connection: _ConnectionBase[Any, Any], authkey: bytes) -> None: ...
6670

67-
def answer_challenge(connection: Connection[Any, Any], authkey: bytes) -> None: ...
71+
def answer_challenge(connection: _ConnectionBase[Any, Any], authkey: bytes) -> None: ...
6872
def wait(
69-
object_list: Iterable[Connection[_SendT_contra, _RecvT_co] | socket.socket | int], timeout: float | None = None
70-
) -> list[Connection[_SendT_contra, _RecvT_co] | socket.socket | int]: ...
71-
def Client(address: _Address, family: str | None = None, authkey: bytes | None = None) -> Connection[Any, Any]: ...
73+
object_list: Iterable[_ConnectionBase[_SendT_contra, _RecvT_co] | socket.socket | int], timeout: float | None = None
74+
) -> list[_ConnectionBase[_SendT_contra, _RecvT_co] | socket.socket | int]: ...
75+
76+
if sys.platform != "win32":
77+
def Client(address: _Address, family: str | None = None, authkey: bytes | None = None) -> Connection[Any, Any]: ...
78+
79+
else:
80+
def Client(
81+
address: _Address, family: str | None = None, authkey: bytes | None = None
82+
) -> Connection[Any, Any] | PipeConnection[Any, Any]: ...
7283

7384
# N.B. Keep this in sync with multiprocessing.context.BaseContext.Pipe.
7485
# _ConnectionBase is the common base class of Connection and PipeConnection

stdlib/tkinter/__init__.pyi

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,8 @@ class Wm:
766766
) -> tuple[int, int, int, int] | None: ...
767767

768768
aspect = wm_aspect
769+
770+
# wm_attributes: Get all attributes
769771
if sys.version_info >= (3, 13):
770772
@overload
771773
def wm_attributes(self, *, return_python_dict: Literal[False] = False) -> tuple[Any, ...]: ...
@@ -775,6 +777,7 @@ class Wm:
775777
@overload
776778
def wm_attributes(self) -> tuple[Any, ...]: ...
777779

780+
# wm_attributes: Get one attribute (old variant using string that starts with "-")
778781
@overload
779782
def wm_attributes(self, option: Literal["-alpha"], /) -> float: ...
780783
@overload
@@ -806,6 +809,7 @@ class Wm:
806809
@overload
807810
def wm_attributes(self, option: Literal["-type"], /) -> str: ...
808811
if sys.version_info >= (3, 13):
812+
# wm_attributes: Get one attribute (new variant without "-")
809813
@overload
810814
def wm_attributes(self, option: Literal["alpha"], /) -> float: ...
811815
@overload
@@ -837,6 +841,7 @@ class Wm:
837841
@overload
838842
def wm_attributes(self, option: Literal["type"], /) -> str: ...
839843

844+
# wm_attributes: Set an attribute (old variant using string that starts with "-")
840845
@overload
841846
def wm_attributes(self, option: str, /): ...
842847
@overload
@@ -868,9 +873,11 @@ class Wm:
868873
@overload
869874
def wm_attributes(self, option: Literal["-type"], value: str, /) -> Literal[""]: ...
870875

876+
# wm_attributes: Set multiple attributes (old variant using strings that start with "-")
871877
@overload
872878
def wm_attributes(self, option: str, value, /, *__other_option_value_pairs: Any) -> Literal[""]: ...
873879

880+
# wm_attributes: Set an attribute (new variant with kwarg instead of string)
874881
if sys.version_info >= (3, 13):
875882
if sys.platform == "darwin":
876883
@overload
@@ -1534,8 +1541,8 @@ class Canvas(Widget, XView, YView):
15341541
def tag_bind(self, tagOrId: str | int, *, func: str, add: Literal["", "+"] | bool | None = None) -> None: ...
15351542

15361543
def tag_unbind(self, tagOrId: str | int, sequence: str, funcid: str | None = None) -> None: ...
1537-
def canvasx(self, screenx, gridspacing=None): ...
1538-
def canvasy(self, screeny, gridspacing=None): ...
1544+
def canvasx(self, screenx: float | str, gridspacing: float | str | None = None) -> float: ...
1545+
def canvasy(self, screeny: float | str, gridspacing: float | str | None = None) -> float: ...
15391546

15401547
@overload
15411548
def coords(self, tagOrId: str | int, /) -> list[float]: ...

stdlib/warnings.pyi

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ if sys.version_info >= (3, 14):
2727
_ActionKind: TypeAlias = Literal["default", "error", "ignore", "always", "module", "once"]
2828
else:
2929
_ActionKind: TypeAlias = Literal["default", "error", "ignore", "always", "all", "module", "once"]
30-
filters: Sequence[tuple[str, re.Pattern[str] | None, type[Warning], re.Pattern[str] | None, int]] # undocumented, do not mutate
30+
filters: Sequence[
31+
tuple[str, re.Pattern[str] | None, type[Warning] | tuple[type[Warning], ...], re.Pattern[str] | None, int]
32+
] # undocumented, do not mutate
3133

3234
def showwarning(
3335
message: Warning | str,
@@ -43,7 +45,9 @@ def formatwarning(
4345
def filterwarnings(
4446
action: _ActionKind, message: str = "", category: type[Warning] = ..., module: str = "", lineno: int = 0, append: bool = False
4547
) -> None: ...
46-
def simplefilter(action: _ActionKind, category: type[Warning] = ..., lineno: int = 0, append: bool = False) -> None: ...
48+
def simplefilter(
49+
action: _ActionKind, category: type[Warning] | tuple[type[Warning], ...] = ..., lineno: int = 0, append: bool = False
50+
) -> None: ...
4751
def resetwarnings() -> None: ...
4852

4953
class _OptionError(Exception): ...
@@ -92,7 +96,7 @@ class catch_warnings(Generic[_W_co]):
9296
record: Literal[False] = False,
9397
module: ModuleType | None = None,
9498
action: _ActionKind | None = None,
95-
category: type[Warning] = ...,
99+
category: type[Warning] | tuple[type[Warning], ...] = ...,
96100
lineno: int = 0,
97101
append: bool = False,
98102
) -> None: ...
@@ -103,7 +107,7 @@ class catch_warnings(Generic[_W_co]):
103107
record: Literal[True],
104108
module: ModuleType | None = None,
105109
action: _ActionKind | None = None,
106-
category: type[Warning] = ...,
110+
category: type[Warning] | tuple[type[Warning], ...] = ...,
107111
lineno: int = 0,
108112
append: bool = False,
109113
) -> None: ...
@@ -114,7 +118,7 @@ class catch_warnings(Generic[_W_co]):
114118
record: bool,
115119
module: ModuleType | None = None,
116120
action: _ActionKind | None = None,
117-
category: type[Warning] = ...,
121+
category: type[Warning] | tuple[type[Warning], ...] = ...,
118122
lineno: int = 0,
119123
append: bool = False,
120124
) -> None: ...

stubs/braintree/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version = "4.43.*"
1+
version = "4.44.*"
22
upstream-repository = "https://github.com/braintree/braintree_python"

stubs/braintree/braintree/credit_card_verification.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class CreditCardVerification(AttributeGetter):
1818

1919
amount: Decimal | None
2020
currency_iso_code: Incomplete
21+
mastercard_transaction_link_id: str | None
2122
processor_response_code: Incomplete
2223
processor_response_text: Incomplete
2324
network_response_code: Incomplete

stubs/braintree/braintree/transaction.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ class Transaction(Resource):
180180
payment_facilitator: PaymentFacilitator
181181
transfer: Transfer
182182
partially_authorized: bool
183+
mastercard_transaction_link_id: str | None
183184
subscription_id: str
184185
created_at: datetime
185186
def __init__(self, gateway, attributes) -> None: ...

0 commit comments

Comments
 (0)