connor-makowski / type_enforced

A pure python type enforcer for annotations. Enforce types in python functions and methods.
MIT License
45 stars 2 forks source link

Bugs when using *args and **kwargs #15

Closed connor-makowski closed 1 year ago

connor-makowski commented 1 year ago

Create a function with *args or **kwargs and attempt to type enforce it. The arguments appear to be passed in incorrectly.

EG:

@type_enforced.Enforcer def my_fn_args(a: int , *args, b: [int, str]=2, c: int=3) -> None: return None

@type_enforced.Enforcer def my_fn_kwargs(a: int, b: [int, str]=2, c: int=3, **kwargs) -> None: return None

@type_enforced.Enforcer def my_fn_args_kwargs(a: int , *args, b: [int, str]=2, c: int=3, **kwargs) -> None: return None

connor-makowski commented 1 year ago

Closing with: b31ecff60f323cc1e465eb411977fe09f03f4e21