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
If a function has many keyword arguments that do not change across all overloads (for example pandas.read_csv). It is more readable and shorter to move all the overload-invariant keywords into a TypedDict and suggest using the Unpack feature which is supported by at least pyright and mypy.
This would probably need some heuristic of when is it worth recommending Unpack: Using a TypedDict for less than insert magic number keywords is probably not helpful.
The text was updated successfully, but these errors were encountered:
We shouldn't do this in typeshed until PEP 692 is accepted. I think it's better to also wait in flake8-pyi.
Yeah, I agree. Hopefully the PEP will be accepted, but until then this is essentially an unofficial/unsanctioned use of this symbol, so I'm not sure we should write a lint enforcing its use just yet. I'll mark this as "deferred" for now :)
The PEP's been accepted now, but mypy's support is still guarded behind --enable-incomplete-feature=Unpack (our typeshed trackig issue is python/typeshed#9710). We probably shouldn't write a lint encouraging it until it's properly supported by all major type checkers.
If a function has many keyword arguments that do not change across all overloads (for example pandas.read_csv). It is more readable and shorter to move all the overload-invariant keywords into a TypedDict and suggest using the
Unpack
feature which is supported by at least pyright and mypy.This would probably need some heuristic of when is it worth recommending Unpack: Using a TypedDict for less than
insert magic number
keywords is probably not helpful.The text was updated successfully, but these errors were encountered: