Skip to content

Commit cedb2fd

Browse files
committed
Small fixups
1 parent e1d09d3 commit cedb2fd

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

mypy/nodes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ class FuncDef(FuncItem, SymbolNode, Statement):
782782
"deco_line",
783783
"is_trivial_body",
784784
"is_mypy_only",
785-
# Present only when a function is decorated with @typing.datasclass_transform or similar
785+
# Present only when a function is decorated with @typing.dataclass_transform or similar
786786
"dataclass_transform_spec",
787787
"docstring",
788788
"deprecated",

test-data/unit/check-typevar-defaults.test

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
[case testTypeVarDefaultsBasic]
2-
import builtins
32
from typing import Generic, TypeVar, ParamSpec, Callable, Tuple, List
43
from typing_extensions import TypeVarTuple, Unpack
54

@@ -10,7 +9,7 @@ Ts1 = TypeVarTuple("Ts1", default=Unpack[Tuple[int, str]])
109
def f1(a: T1) -> List[T1]: ...
1110
reveal_type(f1) # N: Revealed type is "def [T1 = builtins.int] (a: T1`-1 = builtins.int) -> builtins.list[T1`-1 = builtins.int]"
1211

13-
def f2(a: Callable[P1, None] ) -> Callable[P1, None]: ...
12+
def f2(a: Callable[P1, None]) -> Callable[P1, None]: ...
1413
reveal_type(f2) # N: Revealed type is "def [P1 = [builtins.int, builtins.str]] (a: def (*P1.args, **P1.kwargs)) -> def (*P1.args, **P1.kwargs)"
1514

1615
def f3(a: Tuple[Unpack[Ts1]]) -> Tuple[Unpack[Ts1]]: ...
@@ -68,7 +67,7 @@ P2 = ParamSpec("P2", default=2) # E: The default argument to ParamSpec must be
6867
P3 = ParamSpec("P3", default=(2, int)) # E: The default argument to ParamSpec must be a list expression, ellipsis, or a ParamSpec
6968
P4 = ParamSpec("P4", default=[2, int]) # E: Argument 0 of ParamSpec default must be a type
7069

71-
Ts1 = TypeVarTuple("Ts1", default=2) # E: The default argument to TypeVarTuple must be an Unpacked tuple
70+
Ts1 = TypeVarTuple("Ts1", default=2) # E: The default argument to TypeVarTuple must be an Unpacked tuple
7271
Ts2 = TypeVarTuple("Ts2", default=int) # E: The default argument to TypeVarTuple must be an Unpacked tuple
7372
Ts3 = TypeVarTuple("Ts3", default=Tuple[int]) # E: The default argument to TypeVarTuple must be an Unpacked tuple
7473
[builtins fixtures/tuple.pyi]
@@ -181,8 +180,8 @@ reveal_type(func_b1(callback1)) # N: Revealed type is "def (x: builtins.str)"
181180
reveal_type(func_b1(2)) # N: Revealed type is "def (builtins.int, builtins.str)"
182181

183182
def func_c1(x: Union[int, Callable[[Unpack[Ts1]], None]]) -> Tuple[Unpack[Ts1]]: ...
184-
# reveal_type(func_c1(callback1)) # Revealed type is "builtins.tuple[str]" # TODO
185-
# reveal_type(func_c1(2)) # Revealed type is "builtins.tuple[builtins.int, builtins.str]" # TODO
183+
# reveal_type(func_c1(callback1)) # Revealed type is "Tuple[str]" # TODO
184+
reveal_type(func_c1(2)) # N: Revealed type is "Tuple[builtins.int, builtins.str]"
186185
[builtins fixtures/tuple.pyi]
187186

188187
[case testTypeVarDefaultsClass1]

0 commit comments

Comments
 (0)