Skip to content

Commit 662d49e

Browse files
committed
Revert "prefer version with any"
This reverts commit 42631be.
1 parent 42631be commit 662d49e

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

mypy/join.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -414,9 +414,6 @@ def visit_callable_type(self, t: CallableType) -> ProperType:
414414
# We don't want to return unusable Callable, attempt fallback instead.
415415
return join_types(t.fallback, self.s)
416416
else:
417-
s, t = self.s, t
418-
if s.min_args < t.min_args:
419-
s, t = t, s
420417
if is_subtype(self.s, t):
421418
result = t.copy_modified()
422419
elif is_subtype(t, self.s):

test-data/unit/check-functions.test

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3499,12 +3499,12 @@ def f_any(*_, **__): ...
34993499
def f_3(common, b=None, x=None): ...
35003500

35013501
fdict = {
3502-
"f_1": f_1,
3502+
"f_1": f_1, # E: Dict entry 0 has incompatible type "str": "Callable[[Any, Any], Any]"; expected "str": "Callable[[Any, Any, Any], Any]"
35033503
"f_any": f_any,
35043504
"f_3": f_3,
35053505
}
3506-
reveal_type(fdict) # N: Revealed type is "builtins.dict[builtins.str, def (*_: Any, **__: Any) -> Any]"
3507-
3508-
reveal_type(join(f_1, f_any, f_3)) # N: Revealed type is "def (*_: Any, **__: Any) -> Any"
3506+
reveal_type(fdict) # N: Revealed type is "builtins.dict[builtins.str, def (common: Any, b: Any =, x: Any =) -> Any]"
35093507

3508+
reveal_type(join(f_1, f_any, f_3)) # N: Revealed type is "def (common: Any, b: Any =, x: Any =) -> Any" \
3509+
# E: Argument 1 to "join" has incompatible type "Callable[[Any, Any], Any]"; expected "Callable[[Any, Any, Any], Any]"
35103510
[builtins fixtures/tuple.pyi]

0 commit comments

Comments
 (0)