Skip to content

Commit 20f0d2a

Browse files
authored
Merge branch 'main' into fpdf2-2.8.5
2 parents 27daf62 + 8c7256c commit 20f0d2a

File tree

100 files changed

+802
-875
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+802
-875
lines changed

stdlib/@tests/stubtest_allowlists/py314.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ concurrent.interpreters._queues.UNBOUND_REMOVE
4040

4141
importlib.util.Loader.exec_module # See Lib/importlib/_abc.py. Might be defined for backwards compatibility
4242

43+
# Condition functions are exported in __init__
44+
threading.Condition.locked
45+
multiprocessing.dummy.Condition.locked
4346

4447
# ====================================
4548
# Pre-existing errors from Python 3.13

stdlib/asyncio/runners.pyi

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import sys
22
from _typeshed import Unused
3-
from collections.abc import Callable, Coroutine
3+
from collections.abc import Awaitable, Callable, Coroutine
44
from contextvars import Context
55
from typing import Any, TypeVar, final
66
from typing_extensions import Self
@@ -22,7 +22,10 @@ if sys.version_info >= (3, 11):
2222
def __exit__(self, exc_type: Unused, exc_val: Unused, exc_tb: Unused) -> None: ...
2323
def close(self) -> None: ...
2424
def get_loop(self) -> AbstractEventLoop: ...
25-
def run(self, coro: Coroutine[Any, Any, _T], *, context: Context | None = None) -> _T: ...
25+
if sys.version_info >= (3, 14):
26+
def run(self, coro: Awaitable[_T], *, context: Context | None = None) -> _T: ...
27+
else:
28+
def run(self, coro: Coroutine[Any, Any, _T], *, context: Context | None = None) -> _T: ...
2629

2730
if sys.version_info >= (3, 12):
2831
def run(

stdlib/asyncio/trsock.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class TransportSocket:
6262
def listen(self, backlog: int = ..., /) -> None: ...
6363
@deprecated("Removed in Python 3.11")
6464
def makefile(self) -> BinaryIO: ...
65-
@deprecated("Rmoved in Python 3.11")
65+
@deprecated("Removed in Python 3.11")
6666
def sendfile(self, file: BinaryIO, offset: int = 0, count: int | None = None) -> int: ...
6767
@deprecated("Removed in Python 3.11")
6868
def close(self) -> None: ...

stdlib/calendar.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,12 @@ if sys.version_info >= (3, 12):
5656

5757
_LocaleType: TypeAlias = tuple[str | None, str | None]
5858

59-
class IllegalMonthError(ValueError):
59+
class IllegalMonthError(ValueError, IndexError):
60+
month: int
6061
def __init__(self, month: int) -> None: ...
6162

6263
class IllegalWeekdayError(ValueError):
64+
weekday: int
6365
def __init__(self, weekday: int) -> None: ...
6466

6567
def isleap(year: int) -> bool: ...

stdlib/ipaddress.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class _BaseNetwork(_IPAddressBase, Generic[_A]):
7373
@property
7474
def broadcast_address(self) -> _A: ...
7575
def compare_networks(self, other: Self) -> int: ...
76-
def hosts(self) -> Iterator[_A] | list[_A]: ...
76+
def hosts(self) -> Iterator[_A]: ...
7777
@property
7878
def is_global(self) -> bool: ...
7979
@property

stdlib/threading.pyi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ class Condition:
144144
) -> None: ...
145145
def acquire(self, blocking: bool = True, timeout: float = -1) -> bool: ...
146146
def release(self) -> None: ...
147+
if sys.version_info >= (3, 14):
148+
def locked(self) -> bool: ...
149+
147150
def wait(self, timeout: float | None = None) -> bool: ...
148151
def wait_for(self, predicate: Callable[[], _T], timeout: float | None = None) -> _T: ...
149152
def notify(self, n: int = 1) -> None: ...

stdlib/typing.pyi

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,13 @@ _TC = TypeVar("_TC", bound=type[object])
408408

409409
def overload(func: _F) -> _F: ...
410410
def no_type_check(arg: _F) -> _F: ...
411-
def no_type_check_decorator(decorator: Callable[_P, _T]) -> Callable[_P, _T]: ...
411+
412+
if sys.version_info >= (3, 13):
413+
@deprecated("Deprecated since Python 3.13; removed in Python 3.15.")
414+
def no_type_check_decorator(decorator: Callable[_P, _T]) -> Callable[_P, _T]: ...
415+
416+
else:
417+
def no_type_check_decorator(decorator: Callable[_P, _T]) -> Callable[_P, _T]: ...
412418

413419
# This itself is only available during type checking
414420
def type_check_only(func_or_cls: _FT) -> _FT: ...
@@ -1000,9 +1006,7 @@ class NamedTuple(tuple[Any, ...]):
10001006
@overload
10011007
def __init__(self, typename: str, fields: Iterable[tuple[str, Any]], /) -> None: ...
10021008
@overload
1003-
@typing_extensions.deprecated(
1004-
"Creating a typing.NamedTuple using keyword arguments is deprecated and support will be removed in Python 3.15"
1005-
)
1009+
@deprecated("Creating a typing.NamedTuple using keyword arguments is deprecated and support will be removed in Python 3.15")
10061010
def __init__(self, typename: str, fields: None = None, /, **kwargs: Any) -> None: ...
10071011
@classmethod
10081012
def _make(cls, iterable: Iterable[Any]) -> typing_extensions.Self: ...

stdlib/urllib/request.pyi

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,14 @@ if sys.version_info < (3, 14):
4949
__all__ += ["URLopener", "FancyURLopener"]
5050

5151
_T = TypeVar("_T")
52+
53+
# The actual type is `addinfourl | HTTPResponse`, but users would need to use `typing.cast` or `isinstance` to narrow the type,
54+
# so we use `Any` instead.
55+
# See
56+
# - https://github.com/python/typeshed/pull/15042
57+
# - https://github.com/python/typing/issues/566
5258
_UrlopenRet: TypeAlias = Any
59+
5360
_DataType: TypeAlias = ReadableBuffer | SupportsRead[bytes] | Iterable[bytes] | None
5461

5562
if sys.version_info >= (3, 13):

stubs/Pygments/pygments/console.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
from typing import Any
1+
from _typeshed import Incomplete
22

33
esc: str
4-
codes: Any
5-
dark_colors: Any
6-
light_colors: Any
4+
codes: Incomplete
5+
dark_colors: Incomplete
6+
light_colors: Incomplete
77

88
def reset_color(): ...
99
def colorize(color_key, text): ...

stubs/Pygments/pygments/filter.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
from _typeshed import Incomplete
12
from collections.abc import Iterable, Iterator
2-
from typing import Any
33

44
from pygments.lexer import Lexer
55
from pygments.token import _TokenType
@@ -8,11 +8,11 @@ def apply_filters(stream, filters, lexer=None): ...
88
def simplefilter(f): ...
99

1010
class Filter:
11-
options: Any
11+
options: Incomplete
1212
def __init__(self, **options) -> None: ...
1313
def filter(self, lexer: Lexer, stream: Iterable[tuple[_TokenType, str]]) -> Iterator[tuple[_TokenType, str]]: ...
1414

1515
class FunctionFilter(Filter):
16-
function: Any
16+
function: Incomplete
1717
def __init__(self, **options) -> None: ...
1818
def filter(self, lexer: Lexer, stream: Iterable[tuple[_TokenType, str]]) -> Iterator[tuple[_TokenType, str]]: ...

0 commit comments

Comments
 (0)