Skip to content

Commit 9b5b3ec

Browse files
authored
clean up allowlists (#14612)
1 parent f3f5ccc commit 9b5b3ec

File tree

12 files changed

+155
-132
lines changed

12 files changed

+155
-132
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# ===========
2-
# 3.9 to 3.11
3-
# ===========
1+
# =======
2+
# <= 3.11
3+
# =======
44

55
# Added in Python 3.10.15
66
email._header_value_parser.NLSET

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@ fcntl.F_OFD_SETLK
88
fcntl.F_OFD_SETLKW
99

1010

11-
# ===========
12-
# 3.9 to 3.11
13-
# ===========
11+
# =======
12+
# <= 3.11
13+
# =======
1414

15-
# Incompatible changes introduced in Python 3.11.10
16-
# (Remove once 3.11.10 becomes available for MacOS)
15+
# Added in Python 3.11.10
1716
email._header_value_parser.NLSET
1817
email._header_value_parser.SPECIALSNL
1918
email.errors.HeaderWriteError

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# ===========
2-
# 3.9 to 3.11
3-
# ===========
1+
# =======
2+
# <= 3.11
3+
# =======
44

55
# Added in Python 3.9.20
66
email._header_value_parser.NLSET

stdlib/@tests/stubtest_allowlists/py310.txt

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -70,22 +70,11 @@ importlib.metadata._meta.SimplePath.__truediv__ # Runtime definition of protoco
7070
# ===================================
7171

7272

73-
# ===========
74-
# 3.9 to 3.10
75-
# ===========
76-
77-
builtins.float.__setformat__ # Internal method for CPython test suite
78-
typing._SpecialForm.__mro_entries__ # Exists at runtime, but missing from stubs
79-
80-
# Will always raise. Not included to avoid type checkers inferring that
81-
# Sentinel instances are callable.
82-
typing_extensions.Sentinel.__call__
83-
84-
8573
# =======
8674
# <= 3.10
8775
# =======
8876

77+
builtins.float.__setformat__ # Internal method for CPython test suite
8978
email.contentmanager.typ
9079
gettext.install # codeset default value is ['unspecified'] so can't be specified
9180
gettext.translation # codeset default value is ['unspecified'] so can't be specified
@@ -100,6 +89,11 @@ tempfile.SpooledTemporaryFile.seekable
10089
tempfile.SpooledTemporaryFile.writable
10190

10291
tkinter.Tk.split # Exists at runtime, but missing from stubs
92+
typing._SpecialForm.__mro_entries__ # Exists at runtime, but missing from stubs
93+
94+
# Will always raise. Not included to avoid type checkers inferring that
95+
# Sentinel instances are callable.
96+
typing_extensions.Sentinel.__call__
10397

10498

10599
# =======
@@ -212,13 +206,6 @@ importlib.metadata.DeprecatedList.sort
212206
typing.ParamSpec(Args|Kwargs).__origin__
213207

214208

215-
# =================================================================
216-
# Allowlist entries that cannot or should not be fixed; 3.9 to 3.12
217-
# =================================================================
218-
219-
typing\.Annotated # Super-special typing primitive
220-
221-
222209
# =============================================================
223210
# Allowlist entries that cannot or should not be fixed; <= 3.10
224211
# =============================================================
@@ -273,6 +260,11 @@ typing_extensions\.TypeAliasType\.__(parameters|type_params|name|module|value)__
273260
unittest.test # Modules that exist at runtime, but shouldn't be added to typeshed
274261
unittest\.test\..+ # Modules that exist at runtime, but shouldn't be added to typeshed
275262

263+
# Incompatible changes introduced in Python 3.10.17
264+
# (Remove once 3.10.17 becomes available for all platforms)
265+
(email._header_value_parser.get_encoded_word)?
266+
(email._header_value_parser.make_quoted_pairs)?
267+
276268

277269
# =============================================================
278270
# Allowlist entries that cannot or should not be fixed; <= 3.12
@@ -317,11 +309,7 @@ sunau.Au_write.initfp
317309
threading.Lock # Factory function at runtime, but that wouldn't let us use it in type hints
318310
types.SimpleNamespace.__init__ # class doesn't accept positional arguments but has default C signature
319311
typing_extensions\.Annotated # Undocumented implementation details
320-
321-
# Incompatible changes introduced in Python 3.10.17
322-
# (Remove once 3.10.17 becomes available for all platforms)
323-
(email._header_value_parser.get_encoded_word)?
324-
(email._header_value_parser.make_quoted_pairs)?
312+
typing\.Annotated # Super-special typing primitive
325313

326314
# These methods have no default implementation for Python < 3.13.
327315
_pickle.Pickler.persistent_id

stdlib/@tests/stubtest_allowlists/py311.txt

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
# >= 3.11
88
# =======
99

10-
enum.Enum.__init__
1110
typing.NewType.__mro_entries__
1211

1312

@@ -140,11 +139,17 @@ typing\.ByteString
140139
typing_extensions.TypeAliasType.__call__
141140

142141

142+
# ============
143+
# 3.11 to 3.13
144+
# ============
145+
146+
enum.Enum.__init__
147+
148+
143149
# =============================================================
144150
# Allowlist entries that cannot or should not be fixed; >= 3.11
145151
# =============================================================
146152

147-
argparse._MutuallyExclusiveGroup.add_mutually_exclusive_group # deprecated, forwards arguments to super
148153
enum.auto.__init__ # The stub for enum.auto is nothing like the implementation
149154
enum.auto.value # The stub for enum.auto is nothing like the implementation
150155
http.HTTPMethod.description # mutable instance attribute at runtime but we pretend it's a property
@@ -198,11 +203,11 @@ importlib.metadata.DeprecatedList.sort
198203
typing.ParamSpec(Args|Kwargs).__origin__
199204

200205

201-
# =================================================================
202-
# Allowlist entries that cannot or should not be fixed; 3.9 to 3.12
203-
# =================================================================
206+
# ==================================================================
207+
# Allowlist entries that cannot or should not be fixed; 3.11 to 3.13
208+
# ==================================================================
204209

205-
typing\.Annotated # Super-special typing primitive
210+
argparse._MutuallyExclusiveGroup.add_mutually_exclusive_group # deprecated, forwards arguments to super
206211

207212

208213
# =============================================================
@@ -233,6 +238,11 @@ typing_extensions\.TypeAliasType\.__(parameters|type_params|name|module|value)__
233238
unittest.test # Modules that exist at runtime, but shouldn't be added to typeshed
234239
unittest\.test\..+ # Modules that exist at runtime, but shouldn't be added to typeshed
235240

241+
# Incompatible changes introduced in Python 3.11.12
242+
# (Remove once 3.11.12 becomes available for all platforms)
243+
(email._header_value_parser.get_encoded_word)?
244+
(email._header_value_parser.make_quoted_pairs)?
245+
236246

237247
# =============================================================
238248
# Allowlist entries that cannot or should not be fixed; <= 3.12
@@ -277,11 +287,7 @@ sunau.Au_write.initfp
277287
threading.Lock # Factory function at runtime, but that wouldn't let us use it in type hints
278288
types.SimpleNamespace.__init__ # class doesn't accept positional arguments but has default C signature
279289
typing_extensions\.Annotated # Undocumented implementation details
280-
281-
# Incompatible changes introduced in Python 3.11.12
282-
# (Remove once 3.11.12 becomes available for all platforms)
283-
(email._header_value_parser.get_encoded_word)?
284-
(email._header_value_parser.make_quoted_pairs)?
290+
typing\.Annotated # Super-special typing primitive
285291

286292
# These methods have no default implementation for Python < 3.13.
287293
_pickle.Pickler.persistent_id

stdlib/@tests/stubtest_allowlists/py312.txt

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,20 @@
77
# >= 3.12
88
# =======
99

10-
# Initialized at runtime
11-
typing_extensions.TypeAliasType.__parameters__
12-
typing_extensions.TypeAliasType.__value__
13-
1410
# Types that require `__setattr__` and `__delattr__` for typing purposes:
1511
types.SimpleNamespace.__setattr__
1612
types.SimpleNamespace.__delattr__
1713

1814

15+
# ============
16+
# 3.12 to 3.13
17+
# ============
18+
19+
# Initialized at runtime
20+
typing_extensions.TypeAliasType.__parameters__
21+
typing_extensions.TypeAliasType.__value__
22+
23+
1924
# ====================================
2025
# Pre-existing errors from Python 3.11
2126
# ====================================
@@ -25,10 +30,16 @@ types.SimpleNamespace.__delattr__
2530
# >= 3.11
2631
# =======
2732

28-
enum.Enum.__init__
2933
typing.NewType.__mro_entries__
3034

3135

36+
# ============
37+
# 3.11 to 3.13
38+
# ============
39+
40+
enum.Enum.__init__
41+
42+
3243
# =======
3344
# >= 3.10
3445
# =======
@@ -161,7 +172,6 @@ typing_extensions.SupportsRound.__type_params__
161172
# Allowlist entries that cannot or should not be fixed; >= 3.11
162173
# =============================================================
163174

164-
argparse._MutuallyExclusiveGroup.add_mutually_exclusive_group # deprecated, forwards arguments to super
165175
enum.auto.__init__ # The stub for enum.auto is nothing like the implementation
166176
enum.auto.value # The stub for enum.auto is nothing like the implementation
167177
http.HTTPMethod.description # mutable instance attribute at runtime but we pretend it's a property
@@ -171,6 +181,13 @@ typing\._SpecialForm.* # Super-special typing primitive
171181
typing\.LiteralString # Super-special typing primitive
172182

173183

184+
# ==================================================================
185+
# Allowlist entries that cannot or should not be fixed; 3.11 to 3.13
186+
# ==================================================================
187+
188+
argparse._MutuallyExclusiveGroup.add_mutually_exclusive_group # deprecated, forwards arguments to super
189+
190+
174191
# =============================================================
175192
# Allowlist entries that cannot or should not be fixed; >= 3.10
176193
# =============================================================
@@ -202,13 +219,6 @@ ctypes._endian.SIZEOF_TIME_T # Incorrectly star import.
202219
configparser.LegacyInterpolation.__init__ # runtime is *args, **kwargs, but it's just a passthrough
203220

204221

205-
# =================================================================
206-
# Allowlist entries that cannot or should not be fixed; 3.9 to 3.12
207-
# =================================================================
208-
209-
typing\.Annotated # Super-special typing primitive
210-
211-
212222
# =============================================================
213223
# Allowlist entries that cannot or should not be fixed; <= 3.12
214224
# =============================================================
@@ -252,6 +262,7 @@ sunau.Au_write.initfp
252262
threading.Lock # Factory function at runtime, but that wouldn't let us use it in type hints
253263
types.SimpleNamespace.__init__ # class doesn't accept positional arguments but has default C signature
254264
typing_extensions\.Annotated # Undocumented implementation details
265+
typing\.Annotated # Super-special typing primitive
255266

256267
# These methods have no default implementation for Python < 3.13.
257268
_pickle.Pickler.persistent_id

stdlib/@tests/stubtest_allowlists/py313.txt

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,34 @@
1212
# >= 3.12
1313
# =======
1414

15-
# Initialized at runtime
16-
typing_extensions.TypeAliasType.__parameters__
17-
typing_extensions.TypeAliasType.__value__
18-
1915
# Types that require `__setattr__` and `__delattr__` for typing purposes:
2016
types.SimpleNamespace.__setattr__
2117
types.SimpleNamespace.__delattr__
2218

2319

20+
# ============
21+
# 3.12 to 3.13
22+
# ============
23+
24+
# Initialized at runtime
25+
typing_extensions.TypeAliasType.__parameters__
26+
typing_extensions.TypeAliasType.__value__
27+
28+
2429
# =======
2530
# >= 3.11
2631
# =======
2732

28-
enum.Enum.__init__
2933
typing.NewType.__mro_entries__
3034

3135

36+
# ============
37+
# 3.11 to 3.13
38+
# ============
39+
40+
enum.Enum.__init__
41+
42+
3243
# =======
3344
# >= 3.10
3445
# =======
@@ -151,7 +162,6 @@ typing_extensions.SupportsRound.__type_params__
151162
# Allowlist entries that cannot or should not be fixed; >= 3.11
152163
# =============================================================
153164

154-
argparse._MutuallyExclusiveGroup.add_mutually_exclusive_group # deprecated, forwards arguments to super
155165
enum.auto.__init__ # The stub for enum.auto is nothing like the implementation
156166
enum.auto.value # The stub for enum.auto is nothing like the implementation
157167
http.HTTPMethod.description # mutable instance attribute at runtime but we pretend it's a property
@@ -161,6 +171,13 @@ typing\._SpecialForm.* # Super-special typing primitive
161171
typing\.LiteralString # Super-special typing primitive
162172

163173

174+
# ==================================================================
175+
# Allowlist entries that cannot or should not be fixed; 3.11 to 3.13
176+
# ==================================================================
177+
178+
argparse._MutuallyExclusiveGroup.add_mutually_exclusive_group # deprecated, forwards arguments to super
179+
180+
164181
# =============================================================
165182
# Allowlist entries that cannot or should not be fixed; >= 3.10
166183
# =============================================================

0 commit comments

Comments
 (0)