Stubgen support for positional only parameters as per PEP 570
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
Feature
Stubgen should recognize a signature in the shape of func(param1: T1, param2: T2, /) -> T3 if given in the docstring.
Pitch
As https://peps.python.org/pep-0570/ describes, this is common with C extensions. There is currently no way to express these signatures in a way that stubgen can understand and regenerate correctly in the stub.
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 with stubgen's handling of signatures found in extension-module docstrings and compare the required syntax with PEP 570. Verify the generated stub preserves positional-only parameters using the / marker and add or update coverage for a signature such as the one in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100