Encourage typing_extensions.Unpack for many overload-invariant keywords
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 83
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the pandas.read_csv stub example linked in the issue and the project's existing rule implementations and tests. Determine how a rule could identify overload-invariant keyword arguments and what threshold should trigger an Unpack recommendation. Done means the behavior and heuristic are specified, implemented, and covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100