Skip to content

Commit 3e050e9

Browse files
authored
Merge branch 'main' into functools-cache
2 parents 319c3bb + 332fcab commit 3e050e9

File tree

28 files changed

+949
-944
lines changed

28 files changed

+949
-944
lines changed

pyrightconfig.stricter.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
"stubs/grpcio-reflection/grpc_reflection/v1alpha",
4545
"stubs/grpcio-status/grpc_status",
4646
"stubs/grpcio/grpc/__init__.pyi",
47-
"stubs/gunicorn",
4847
"stubs/hdbcli/hdbcli/dbapi.pyi",
4948
"stubs/html5lib",
5049
"stubs/httplib2",

stdlib/@tests/test_cases/check_types.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
import sys
44
import types
55
from collections import UserDict
6-
from typing import Union
6+
from typing import Any, Literal, TypeVar, Union
77
from typing_extensions import assert_type
88

9+
_T = TypeVar("_T")
10+
911
# test `types.SimpleNamespace`
1012

1113
# Valid:
@@ -58,3 +60,13 @@ def foo(self, value: int) -> None:
5860
@foo.deleter
5961
def foo(self) -> None:
6062
self._value = None
63+
64+
65+
if sys.version_info > (3, 10):
66+
union_type = int | list[_T]
67+
68+
# ideally this would be `_SpecialForm` (Union)
69+
assert_type(union_type | Literal[1], types.UnionType | Any)
70+
# Both mypy and pyright special-case this operation,
71+
# but in different ways, so we just check that no error is emitted:
72+
_ = union_type[int]

stdlib/curses/__init__.pyi

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ _T = TypeVar("_T")
1414
_P = ParamSpec("_P")
1515

1616
# available after calling `curses.initscr()`
17-
LINES: Final[int]
18-
COLS: Final[int]
17+
# not `Final` as it can change during the terminal resize:
18+
LINES: int
19+
COLS: int
1920

2021
# available after calling `curses.start_color()`
2122
COLORS: Final[int]

stdlib/dbm/sqlite3.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ class _Database(MutableMapping[bytes, bytes]):
2626
def __enter__(self) -> Self: ...
2727
def __exit__(self, *args: Unused) -> None: ...
2828

29-
def open(filename: StrOrBytesPath, /, flag: Literal["r", "w,", "c", "n"] = "r", mode: int = 0o666) -> _Database: ...
29+
def open(filename: StrOrBytesPath, /, flag: Literal["r", "w", "c", "n"] = "r", mode: int = 0o666) -> _Database: ...

stdlib/importlib/resources/_common.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ if sys.version_info >= (3, 11):
2121
@overload
2222
def files(anchor: Anchor | None = None) -> Traversable: ...
2323
@overload
24-
@deprecated("First parameter to files is renamed to 'anchor'")
24+
@deprecated("Deprecated since Python 3.12; will be removed in Python 3.15. Use `anchor` parameter instead.")
2525
def files(package: Anchor | None = None) -> Traversable: ...
2626

2727
else:

0 commit comments

Comments
 (0)