You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cloup currently uses overloading (and a lot of ugly signature replication) to work around mypy limitations
These are a couple of relevant Mypy/Pyrefly issues that when solved may improve the situation:
This would allow for better types for the parameter decorators in the case where a custom class is provided. Currently we are forced to annotate **attrs: Any, while **attrs should be a typed dict that expands OptionKwargs/ArgumentKwargs.
Cloup currently uses overloading (and a lot of ugly signature replication) to work around mypy limitations
These are a couple of relevant Mypy/Pyrefly issues that when solved may improve the situation:
Open issues
Unable to specify a default value for a generic parameter python/mypy#3737
This would make overloading unnecessary.
PEP 728
This would allow for better types for the parameter decorators in the case where a custom class is provided. Currently we are forced to annotate
**attrs: Any, while**attrsshould be a typed dict that expandsOptionKwargs/ArgumentKwargs.Closed issues
Allow using TypedDict for more precise typing of **kwds python/mypy#4441
This allows to avoid replication of kwargs annotations.
UPDATE: we now use this for parameter decorators. We still don't for command decorators.