Skip to content

Commit daba172

Browse files
committed
Fix weird stuff
1 parent 7916bf1 commit daba172

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

mypy/checkexpr.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@
124124
from mypy.subtypes import (
125125
covers_at_runtime,
126126
find_member,
127-
is_equivalent,
128127
is_same_type,
129128
is_subtype,
130129
non_method_protocol_members,
@@ -1845,7 +1844,7 @@ def check_callable_call(
18451844
if (
18461845
callee.is_type_obj()
18471846
and (len(arg_types) == 1)
1848-
and is_equivalent(callee.ret_type, self.named_type("builtins.type"))
1847+
and is_named_instance(callee.get_instance_type(), "builtins.type")
18491848
):
18501849
callee = callee.copy_modified(ret_type=TypeType.make_normalized(arg_types[0]))
18511850

test-data/unit/check-classes.test

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7324,11 +7324,12 @@ class A:
73247324
pass
73257325

73267326
class B:
7327-
def __new__(cls) -> Any:
7327+
def __new__(cls, x: int = 0) -> Any:
73287328
pass
73297329

73307330
reveal_type(A()) # N: Revealed type is "__main__.A"
73317331
reveal_type(B()) # N: Revealed type is "Any"
7332+
reveal_type(B(1)) # N: Revealed type is "Any"
73327333

73337334
[case testNewReturnType3]
73347335

0 commit comments

Comments
 (0)