basedmypy icon indicating copy to clipboard operation
basedmypy copied to clipboard

Unions in wrong order / duplicated when inferring positional only overloads

Open KotlinIsland opened this issue 3 years ago • 0 comments

from typing import overload
@overload
def f(b: str, d: int, /): ...
@overload
def f(a: int, b: int): ...
def f(a, b):
    reveal_type(a)  # "int | str"
    reveal_type(b)  # "int | int"

KotlinIsland avatar Aug 07 '22 04:08 KotlinIsland