Skip to content

(馃悶) overlapping Callables are incorrectly joined into builtins.function#17479

Description

@KotlinIsland
from typing import Callable, _T as T

def join(t1: T, t2: T) -> T: ...
    
def f1() -> None: ...
def f2(i: int = 0) -> None: ...

fn: Callable[[], None] = join(f1, f2)  # Incompatible types in assignment (expression has type "function", variable has type "Callable[[], None]")  [assignment]

f2 is a valid () -> None, this code should not produce any problems

if there is any concern that this is a duplicate of #17478, the difference is that this scenario is:
join( () -> None, (int=) -> None )
and #17479 is
join( () -> None, (int) -> None )

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions