couling / dataclass-click

Wrapper for pallets/click that uses dataclasses instead of kwargs
BSD 3-Clause "New" or "Revised" License
4 stars 0 forks source link

Fix decorator type hinting with overload #7

Closed couling closed 5 months ago

couling commented 5 months ago

Mypy was throwing an error with KWarg form of the decoratror. Fixed this using @overload

This should be fine now:

@click.command()
@dataclass_click(BarType, kw_name="bar")
def main(bar: BarType):
    ...