Skip to content

Commit 9c2cc84

Browse files
committed
cleanup
1 parent f291d54 commit 9c2cc84

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

mypy/checkmember.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ def type_object_type(info: TypeInfo, builtin_type: Callable[[str], Instance]) ->
819819
arg_names=["_args", "_kwds"],
820820
ret_type=any_type,
821821
fallback=builtin_type('builtins.function'))
822-
return class_callable(sig, info, fallback, None)
822+
return class_callable(sig, info, fallback, None, is_new=False)
823823

824824
# Otherwise prefer __init__ in a tie. It isn't clear that this
825825
# is the right thing, but __new__ caused problems with
@@ -884,13 +884,12 @@ def type_object_type_from_function(signature: FunctionLike,
884884

885885
def class_callable(init_type: CallableType, info: TypeInfo, type_type: Instance,
886886
special_sig: Optional[str],
887-
is_new: bool = False) -> CallableType:
887+
is_new: bool) -> CallableType:
888888
"""Create a type object type based on the signature of __init__."""
889889
variables = [] # type: List[TypeVarDef]
890890
variables.extend(info.defn.type_vars)
891891
variables.extend(init_type.variables)
892892

893-
is_new = True
894893
if is_new and isinstance(init_type.ret_type, (Instance, TupleType)):
895894
ret_type = init_type.ret_type # type: Type
896895
else:

0 commit comments

Comments
 (0)