Skip to content

**kwargs checked against wrong type with defaults or *args #1969

Closed
@kcr

Description

@kcr
def a(*args: str, **kw: int) -> None:
    b(**kw)
    b('', **kw)
    c(**kw)
    c('', **kw)

def b(args: str='', **kw: int) -> None:
    pass

def c(*args: str, **kw: int) -> None:
    pass

results, with 0.4.3:

/tmp/minimize.py: note: In function "a":
/tmp/minimize.py:2: error: Argument 1 to "b" has incompatible type **Dict[str, int]; expected "str"
/tmp/minimize.py:4: error: Argument 1 to "c" has incompatible type **Dict[str, int]; expected "str"

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions