Skip to content

Commit c7dbe6a

Browse files
committed
fix merge
1 parent d6e4338 commit c7dbe6a

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

test-data/unit/check-lowercase.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ x = 3 # E: Incompatible types in assignment (expression has type "int", variabl
4848
x: type[type] # E: Type[...] can't contain another Type[...]
4949
y: int
5050

51-
y = x # E: Incompatible types in assignment (expression has type "type[type]", variable has type "int")
51+
y = x # E: Incompatible types in assignment (expression has type "type[Any]", variable has type "int")
5252

5353
[case testLowercaseSettingOnTypeAnnotationHint]
5454
# flags: --python-version 3.9 --no-force-uppercase-builtins

test-data/unit/check-newsemanal.test

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3244,6 +3244,7 @@ y = 1[y] # E: Value of type "int" is not indexable \
32443244
[case testBuiltinTypeType]
32453245
# flags: --python-version 3.10 --disallow-any-generics
32463246

3247+
import types
32473248
from typing import Any, cast, Union, TypeVar
32483249
from typing_extensions import TypeAlias
32493250

@@ -3285,8 +3286,8 @@ def p(q: O) -> O: ...
32853286
reveal_type(p(str)) # N: Revealed type is "def () -> builtins.str"
32863287
p(1) # E: Value of type variable "O" of "p" cannot be "int"
32873288

3288-
type[str](1) # E: "builtins.type" is indexable as a type hint but neither a generic class nor a generic function
3289-
r = type[str]("r", (), {}) # E: "builtins.type" is indexable as a type hint but neither a generic class nor a generic function
3289+
type[str](1) # E: "GenericAlias" not callable
3290+
r = type[str]("r", (), {}) # E: "GenericAlias" not callable
32903291
class S(type[str]): ... # E: "builtins.type" is indexable as a type hint but neither a generic class nor a generic function
32913292

32923293
[builtins fixtures/tuple.pyi]

test-data/unit/fixtures/isinstance.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class object:
77

88
class type:
99
def __init__(self, x) -> None: pass
10-
def __or__(self, other: type) -> type: pass
10+
def __or__(self, other: type[Any]) -> type[Any]: pass
1111

1212
class tuple(Generic[T]): pass
1313

0 commit comments

Comments
 (0)