microsoft / pyright

Static Type Checker for Python
Other
13.32k stars 1.45k forks source link

Bad signature when using `Unpack` with empty `TypedDict` #8712

Closed Viicos closed 2 months ago

Viicos commented 2 months ago

Really minor issue:

Code sample in pyright playground

from typing import Unpack, TypedDict

class Empty(TypedDict, total=False):
    pass

def func(**kwargs: Unpack[Empty]): pass

func()

Produces:

image

maybe () -> None could be more appropriate.

erictraut commented 2 months ago

Thanks for the bug report. This will be addressed in the next release of pyright.

erictraut commented 2 months ago

This is addressed in pyright 1.1.376.