Skip to content

Commit 5bddbad

Browse files
authored
Fix pointless changes
1 parent 8e80dc7 commit 5bddbad

File tree

2 files changed

+41
-28
lines changed

2 files changed

+41
-28
lines changed

Lib/test/test_typing.py

Lines changed: 41 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,52 @@
1-
import abc
2-
import collections
31
import contextlib
2+
import collections
3+
from collections import defaultdict
4+
from functools import lru_cache, wraps
45
import inspect
56
import itertools
67
import pickle
78
import re
89
import sys
10+
import warnings
11+
from unittest import TestCase, main, skipUnless, skip
12+
from unittest.mock import patch
13+
from copy import copy, deepcopy
14+
15+
from typing import Any, NoReturn, Never, assert_never
16+
from typing import overload, get_overloads, clear_overloads
17+
from typing import TypeVar, TypeVarTuple, Unpack, AnyStr
18+
from typing import T, KT, VT # Not in __all__.
19+
from typing import Union, Optional, Literal
20+
from typing import Tuple, List, Dict, MutableMapping
21+
from typing import Callable
22+
from typing import Generic, ClassVar, Final, final, Protocol
23+
from typing import assert_type, cast, runtime_checkable
24+
from typing import get_type_hints
25+
from typing import get_origin, get_args
26+
from typing import override
27+
from typing import is_typeddict
28+
from typing import reveal_type
29+
from typing import dataclass_transform
30+
from typing import no_type_check, no_type_check_decorator
31+
from typing import Type
32+
from typing import NamedTuple, NotRequired, Required, TypedDict
33+
from typing import IO, TextIO, BinaryIO
34+
from typing import Pattern, Match
35+
from typing import Annotated, ForwardRef
36+
from typing import Self, LiteralString
37+
from typing import TypeAlias
38+
from typing import ParamSpec, Concatenate, ParamSpecArgs, ParamSpecKwargs
39+
from typing import TypeGuard
40+
import abc
941
import textwrap
10-
import types
1142
import typing
12-
import warnings
1343
import weakref
14-
from collections import defaultdict
15-
from copy import copy, deepcopy
16-
from functools import lru_cache, wraps
17-
from test import _typed_dict_helper, mod_generics_cache
18-
from test.support import captured_stderr, cpython_only, import_helper
19-
from typing import (IO, KT, VT, Annotated, Any, AnyStr, # Not in __all__.
20-
BinaryIO, Callable, ClassVar, Concatenate, Dict, Final,
21-
ForwardRef, Generic, List, Literal, LiteralString, Match,
22-
MutableMapping, NamedTuple, Never, NoReturn, NotRequired,
23-
Optional, ParamSpec, ParamSpecArgs, ParamSpecKwargs,
24-
Pattern, Protocol, Required, Self, T, TextIO, Tuple, Type,
25-
TypeAlias, TypedDict, TypeGuard, TypeVar, TypeVarTuple,
26-
Union, Unpack, assert_never, assert_type, cast,
27-
clear_overloads, dataclass_transform, final, get_args,
28-
get_origin, get_overloads, get_type_hints, is_typeddict,
29-
no_type_check, no_type_check_decorator, overload, override,
30-
reveal_type, runtime_checkable)
31-
from unittest import TestCase, main, skip, skipUnless
32-
from unittest.mock import patch
44+
import types
45+
46+
from test.support import import_helper, captured_stderr, cpython_only
47+
from test import mod_generics_cache
48+
from test import _typed_dict_helper
49+
3350

3451
CANNOT_SUBCLASS_TYPE = 'Cannot subclass special typing classes'
3552
NOT_A_BASE_TYPE = "type 'typing.%s' is not an acceptable base type"
@@ -4734,7 +4751,6 @@ def test_errors(self):
47344751
# We need this to make sure that `@no_type_check` respects `__module__` attr:
47354752
from test import ann_module8
47364753

4737-
47384754
@no_type_check
47394755
class NoTypeCheck_Outer:
47404756
Inner = ann_module8.NoTypeCheck_Outer.Inner
@@ -7344,7 +7360,7 @@ def stuff(a: BinaryIO) -> bytes:
73447360
def test_io_submodule(self):
73457361
with warnings.catch_warnings(record=True) as w:
73467362
warnings.filterwarnings("default", category=DeprecationWarning)
7347-
from typing.io import IO, BinaryIO, TextIO, __all__, __name__
7363+
from typing.io import IO, TextIO, BinaryIO, __all__, __name__
73487364
self.assertIs(IO, typing.IO)
73497365
self.assertIs(TextIO, typing.TextIO)
73507366
self.assertIs(BinaryIO, typing.BinaryIO)
@@ -8568,7 +8584,6 @@ class AllTests(BaseTestCase):
85688584

85698585
def test_all(self):
85708586
from typing import __all__ as a
8571-
85728587
# Just spot-check the first and last of every category.
85738588
self.assertIn('AbstractSet', a)
85748589
self.assertIn('ValuesView', a)

Objects/genericaliasobject.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ _Py_make_parameters(PyObject *args)
218218
for (Py_ssize_t iarg = 0; iarg < nargs; iarg++) {
219219
PyObject *t = PyTuple_GET_ITEM(args, iarg);
220220
PyObject *subst;
221-
222221
// We don't want __parameters__ descriptor of a bare Python class.
223222
if (PyType_Check(t)) {
224223
continue;
@@ -271,7 +270,6 @@ _Py_make_parameters(PyObject *args)
271270
for (Py_ssize_t j = 0; j < len2; j++) {
272271
PyObject *default_;
273272
PyObject *t2 = PyTuple_GET_ITEM(subparams, j);
274-
275273
bool does_not_contain = tuple_index(parameters, nargs, t2) == -1;
276274
if (does_not_contain) {
277275
if (_PyObject_LookupAttr(t2, &_Py_ID(__default__), &default_) < 0) {

0 commit comments

Comments
 (0)