Skip to content

Commit 06a120b

Browse files
Merge branch 'main' into codex/python315-urllib
2 parents 83e3549 + 6a4075c commit 06a120b

58 files changed

Lines changed: 1226 additions & 416 deletions

Some content is hidden

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

.github/workflows/tests.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,7 @@ jobs:
7171
- uses: actions/checkout@v6
7272
- uses: actions/setup-python@v6
7373
with:
74-
python-version: "3.15"
75-
allow-prereleases: true
76-
check-latest: true
74+
python-version: "3.14"
7775
- uses: astral-sh/setup-uv@v7
7876
with:
7977
version-file: "requirements-tests.txt"

requirements-tests.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Type checkers that we test our stubs against. These should always
22
# be pinned to a specific version to make failure reproducible.
3-
mypy==1.20.0
3+
mypy==2.0.0
44
pyright==1.1.409
55

66
# Libraries used by our various scripts.

stdlib/@tests/stubtest_allowlists/darwin-py315.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@
22
# TODO: Allowlist entries that should be fixed
33
# ============================================
44

5-
_decimal.SPEC_VERSION
65
_pyrepl.fancy_termios
76
_pyrepl.unix_console
87
_pyrepl.unix_eventqueue
98
ctypes.c_double_complex._type_
109
ctypes.c_float_complex._type_
1110
ctypes.c_longdouble_complex._type_
12-
decimal.SPEC_VERSION
1311
mmap.MS_ASYNC
1412
mmap.MS_INVALIDATE
1513
mmap.MS_SYNC

stdlib/@tests/stubtest_allowlists/py315.txt

Lines changed: 4 additions & 154 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# TODO: Allowlist entries that should be fixed
33
# ============================================
44

5-
_collections_abc.__all__
65
_frozen_importlib.BuiltinImporter.load_module
76
_frozen_importlib.FrozenImporter.load_module
87
_frozen_importlib_external.FileFinder.discover
@@ -15,10 +14,6 @@ _frozen_importlib_external._LoaderBasics.load_module
1514
_frozen_importlib_external.cache_from_source
1615
_interpqueues.create
1716
_interpqueues.put
18-
_json.make_scanner.array_hook
19-
_json.scanstring
20-
_pydecimal.SPEC_VERSION
21-
_pydecimal.__all__
2217
_pyrepl.base_eventqueue
2318
_pyrepl.commands
2419
_pyrepl.completing_reader
@@ -41,7 +36,6 @@ _pyrepl.types
4136
_pyrepl.utils
4237
_pyrepl.windows_console
4338
_pyrepl.windows_eventqueue
44-
_sqlite3.SQLITE_KEYWORDS
4539
_ssl.HAS_PSK_TLS13
4640
_ssl._SSLContext.get_groups
4741
_ssl._SSLContext.set_ciphersuites
@@ -66,75 +60,9 @@ annotationlib.ForwardRef.__resolved_str__
6660
annotationlib.ForwardRef.__resolved_str_cache__
6761
annotationlib.ForwardRef.__slots__
6862
annotationlib.ForwardRef.__stringifier_dict__
69-
argparse.ArgumentParser.__init__
70-
argparse.ArgumentParser._get_formatter
71-
argparse.ArgumentParser.format_help
72-
argparse.ArgumentParser.format_usage
73-
argparse.HelpFormatter.__init__
74-
array.typecodes
75-
ast.DictComp.value
76-
ast.Import.__match_args__
77-
ast.Import.is_lazy
78-
ast.ImportFrom.__match_args__
79-
ast.ImportFrom.is_lazy
80-
ast.dump
81-
ast.parse
8263
ast.type_param.__init__
83-
asyncio.taskgroups.TaskGroup.cancel
84-
asyncio.tools.display_awaited_by_tasks_table
85-
asyncio.tools.display_awaited_by_tasks_tree
86-
base64.a85decode
87-
base64.b16decode
88-
base64.b16encode
89-
base64.b32decode
90-
base64.b32encode
91-
base64.b32hexdecode
92-
base64.b32hexencode
64+
# base64.b64decode uses a private sentinel list as the default for parameters whose public types are bool/buffer.
9365
base64.b64decode
94-
base64.b64encode
95-
base64.b85decode
96-
base64.b85encode
97-
base64.urlsafe_b64decode
98-
base64.urlsafe_b64encode
99-
base64.z85decode
100-
base64.z85encode
101-
binascii.ASCII85_ALPHABET
102-
binascii.BASE32HEX_ALPHABET
103-
binascii.BASE32_ALPHABET
104-
binascii.BASE64_ALPHABET
105-
binascii.BASE85_ALPHABET
106-
binascii.BINHEX_ALPHABET
107-
binascii.CRYPT_ALPHABET
108-
binascii.URLSAFE_BASE64_ALPHABET
109-
binascii.UU_ALPHABET
110-
binascii.Z85_ALPHABET
111-
binascii.a2b_ascii85
112-
binascii.a2b_base32
113-
binascii.a2b_base64
114-
binascii.a2b_base85
115-
binascii.a2b_hex
116-
binascii.b2a_ascii85
117-
binascii.b2a_base32
118-
binascii.b2a_base64
119-
binascii.b2a_base85
120-
binascii.unhexlify
121-
builtins.ImportCycleError
122-
builtins.__lazy_import__
123-
builtins.bin
124-
builtins.bytearray.replace
125-
builtins.bytearray.take_bytes
126-
builtins.bytes.replace
127-
builtins.compile
128-
builtins.frozendict
129-
builtins.hex
130-
builtins.oct
131-
builtins.sentinel
132-
builtins.slice.__class_getitem__
133-
cProfile.label
134-
calendar.HTMLCalendar.formatmonthpage
135-
calendar.__all__
136-
calendar.standalone_month_abbr
137-
calendar.standalone_month_name
13866
codecs.backslashreplace_errors
13967
codecs.ignore_errors
14068
codecs.namereplace_errors
@@ -143,7 +71,6 @@ codecs.strict_errors
14371
codecs.xmlcharrefreplace_errors
14472
collections.Counter.__ixor__
14573
collections.Counter.__xor__
146-
collections.abc.__all__
14774
concurrent.interpreters._crossinterp.UNBOUND_ERROR
14875
concurrent.interpreters._crossinterp.UNBOUND_REMOVE
14976
concurrent.interpreters._crossinterp.UnboundItem.singleton
@@ -158,16 +85,8 @@ concurrent.interpreters._crossinterp.classonly.__wrapped__
15885
copy.deepcopy
15986
ctypes.SetPointerType
16087
dataclasses._MISSING_TYPE
161-
datetime.date.fromisoformat
162-
datetime.date.strptime
163-
datetime.datetime.fromisoformat
164-
datetime.datetime.strptime
165-
datetime.time.fromisoformat
166-
datetime.time.strptime
167-
dbm.dumb._Database.reorganize
168-
dbm.sqlite3.REORGANIZE
169-
dbm.sqlite3._Database.reorganize
170-
difflib.unified_diff
88+
dataclasses.MISSING
89+
dataclasses.field
17190
doctest.DocTestRunner.report_skip
17291
enum.__all__
17392
enum.auto.__init__
@@ -214,9 +133,6 @@ io.Reader.__class_getitem__
214133
io.Reader.read
215134
io.Writer.__class_getitem__
216135
io.Writer.write
217-
json.decoder.JSONDecoder.__init__
218-
json.load
219-
json.loads
220136
mailbox.Mailbox.__enter__
221137
mailbox.Mailbox.__exit__
222138
mailbox._ProxyFile.__class_getitem__
@@ -294,32 +210,12 @@ profiling.sampling.sample
294210
profiling.sampling.stack_collector
295211
profiling.sampling.string_table
296212
profiling.tracing
297-
pstats.Stats.print_call_subheading
298213
pydoc.Doc.STDLIB_DIR
299214
pydoc.Doc.getdocloc
300-
pyexpat.XMLParserType.SetBillionLaughsAttackProtectionActivationThreshold
301-
pyexpat.XMLParserType.SetBillionLaughsAttackProtectionMaximumAmplification
302-
re.Pattern.prefixmatch
303-
re.__all__
304-
re.prefixmatch
305-
shelve.BsdDbShelf.__init__
306-
shelve.DbfilenameShelf.__init__
307-
shelve.Shelf.__init__
308-
shelve.Shelf.reorganize
309-
shelve.ShelveError
310-
shelve.__all__
311-
shelve.open
312215
site.addsitedir
313216
site.addsitepackages
314217
site.addusersitepackages
315218
site.process_startup_files
316-
sqlite3.Connection.create_aggregate
317-
sqlite3.Connection.create_function
318-
sqlite3.Connection.set_authorizer
319-
sqlite3.Connection.set_progress_handler
320-
sqlite3.Connection.set_trace_callback
321-
sqlite3.SQLITE_KEYWORDS
322-
sqlite3.dbapi2.SQLITE_KEYWORDS
323219
sre_compile
324220
sre_constants
325221
sre_parse
@@ -329,18 +225,6 @@ ssl.SSLObject.server_sigalg
329225
ssl.SSLSocket.client_sigalg
330226
ssl.SSLSocket.group
331227
ssl.SSLSocket.server_sigalg
332-
stat.STATX_ATTR_APPEND
333-
stat.STATX_ATTR_AUTOMOUNT
334-
stat.STATX_ATTR_COMPRESSED
335-
stat.STATX_ATTR_DAX
336-
stat.STATX_ATTR_ENCRYPTED
337-
stat.STATX_ATTR_IMMUTABLE
338-
stat.STATX_ATTR_MOUNT_ROOT
339-
stat.STATX_ATTR_NODUMP
340-
stat.STATX_ATTR_VERITY
341-
stat.STATX_ATTR_WRITE_ATOMIC
342-
symtable.Function.get_cells
343-
symtable.Symbol.is_cell
344228
symtable.symtable
345229
sys.__jit
346230
sys._monitoring
@@ -351,8 +235,6 @@ sys.last_exc
351235
sys.lazy_modules
352236
sys.set_lazy_imports
353237
sys.set_lazy_imports_filter
354-
sysconfig.is_python_build
355-
tarfile.TarFile.__init__
356238
threading.Condition.locked
357239
threading.__all__
358240
threading.concurrent_tee
@@ -391,50 +273,18 @@ types.UnionType.__qualname__
391273
types.__all__
392274
typing.LiteralString
393275
typing.NewType.__mro_entries__
394-
typing.NoExtraItems
395276
typing.ParamSpec.__mro_entries__
396277
typing.ParamSpecArgs.__mro_entries__
397278
typing.ParamSpecKwargs.__mro_entries__
398279
typing.SupportsAbs.__type_params__
399280
typing.SupportsRound.__type_params__
400-
typing.TypeAliasType.__qualname__
401-
typing.TypeForm
402281
typing.TypeVar.__mro_entries__
403-
typing.TypeVarTuple.__bound__
404-
typing.TypeVarTuple.__contravariant__
405-
typing.TypeVarTuple.__covariant__
406-
typing.TypeVarTuple.__infer_variance__
407282
typing.TypeVarTuple.__mro_entries__
408283
typing.Union
409284
typing._SpecialForm.__mro_entries__
410-
typing.__all__
411-
typing.disjoint_base
412-
typing.no_type_check_decorator
285+
typing_extensions.__all__
413286
typing_extensions.Protocol
414-
unicodedata.block
415-
unicodedata.extended_pictographic
416-
unicodedata.grapheme_cluster_break
417-
unicodedata.indic_conjunct_break
418-
unicodedata.isxidcontinue
419-
unicodedata.isxidstart
420-
unicodedata.iter_graphemes
421-
unittest._log._AssertLogsContext.__init__
422-
unittest.case.TestCase.assertLogs
423-
warnings.WarningMessage.__init__
424-
wave.WAVE_FORMAT_EXTENSIBLE
425-
wave.WAVE_FORMAT_IEEE_FLOAT
426-
wave.Wave_read.getformat
427-
wave.Wave_read.getmark
428-
wave.Wave_read.getmarkers
429-
wave.Wave_write.getformat
430-
wave.Wave_write.getmark
431-
wave.Wave_write.getmarkers
432-
wave.Wave_write.setformat
433-
wave.Wave_write.setmark
434-
wave.__all__
435287
xml.etree.ElementTree.__all__
436288
xml.is_valid_name
437289
xml.utils
438290
zipimport.zipimporter.load_module
439-
zlib.adler32_combine
440-
zlib.crc32_combine

stdlib/@tests/stubtest_allowlists/win32-py315.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# TODO: Allowlist entries that should be fixed
33
# ============================================
44

5-
_decimal.SPEC_VERSION
65
_socket.IPV6_HDRINCL
76
_winapi.DeregisterEventSource
87
_winapi.EVENTLOG_AUDIT_FAILURE
@@ -15,7 +14,6 @@ _winapi.GetOEMCP
1514
_winapi.RegisterEventSource
1615
_winapi.ReportEvent
1716
asyncio.windows_events.IocpProactor.finish_socket_func
18-
decimal.SPEC_VERSION
1917
socket.IPV6_HDRINCL
2018
socket.__all__
2119
winreg.DeleteTree

stdlib/_collections_abc.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@ __all__ = [
6060
"ValuesView",
6161
"Sequence",
6262
"MutableSequence",
63-
"ByteString",
6463
]
64+
if sys.version_info < (3, 15):
65+
__all__ += ["ByteString"]
6566
if sys.version_info >= (3, 12):
6667
__all__ += ["Buffer"]
6768

stdlib/_decimal.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ _TrapType: TypeAlias = type[DecimalException]
2525

2626
__version__: Final[str]
2727
__libmpdec_version__: Final[str]
28+
if sys.version_info >= (3, 15):
29+
SPEC_VERSION: Final[str]
2830

2931
ROUND_DOWN: Final = "ROUND_DOWN"
3032
ROUND_HALF_UP: Final = "ROUND_HALF_UP"

stdlib/_json.pyi

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sys
12
from collections.abc import Callable
23
from typing import Any, final
34
from typing_extensions import Self
@@ -36,6 +37,8 @@ class make_encoder:
3637

3738
@final
3839
class make_scanner:
40+
if sys.version_info >= (3, 15):
41+
array_hook: Any
3942
object_hook: Any
4043
object_pairs_hook: Any
4144
parse_int: Any
@@ -48,4 +51,9 @@ class make_scanner:
4851

4952
def encode_basestring(s: str, /) -> str: ...
5053
def encode_basestring_ascii(s: str, /) -> str: ...
51-
def scanstring(string: str, end: int, strict: bool = True) -> tuple[str, int]: ...
54+
55+
if sys.version_info >= (3, 15):
56+
def scanstring(pystr: str, end: int, strict: bool = True, /) -> tuple[str, int]: ...
57+
58+
else:
59+
def scanstring(string: str, end: int, strict: bool = True) -> tuple[str, int]: ...

stdlib/_pydecimal.pyi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,6 @@ __all__ = [
4545

4646
if sys.version_info >= (3, 14):
4747
__all__ += ["IEEEContext", "IEEE_CONTEXT_MAX_BITS"]
48+
49+
if sys.version_info >= (3, 15):
50+
__all__ += ["SPEC_VERSION"]

stdlib/_sqlite3.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ SQLITE_SAVEPOINT: Final = 32
6969
SQLITE_SELECT: Final = 21
7070
SQLITE_TRANSACTION: Final = 22
7171
SQLITE_UPDATE: Final = 23
72+
if sys.version_info >= (3, 15):
73+
SQLITE_KEYWORDS: tuple[str, ...]
7274
adapters: dict[tuple[type[Any], type[Any]], _Adapter[Any]]
7375
converters: dict[str, _Converter]
7476
sqlite_version: str

0 commit comments

Comments
 (0)