PEP 677: Callable Type Syntax
Open
Nobody has claimed this yet.
- Dominant language
- reStructuredText
- Stars
- 5k
- Forks
- 1.8k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 25
Description
Documentation
(A clear and concise description of the issue.)
In one of your examples there seems to me to be a small oversight:
from typing import Any, Callable, Concatenate, ParamSpec, TypeVar
R = TypeVar("R")
P = ParamSpec("P")
def with_retries(
f: Callable[P, R]
) -> Callable[Concatenate[bool, P] R]:
def wrapper(retry_once: bool, *args: P.args, **kwargs: P.kwargs) -> R:
...
return wrapper
...
where -> Callable[Concatenate[bool, P] R]:
do: -> Callable[Concatenate[bool, P], R]:
Thanks very much
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
Open the PEP 677 documentation and find the with_retries example containing Callable[Concatenate[bool, P] R]. Compare the reported annotation with the surrounding example and correct the documented typo. Done means the example uses the valid form and the PEP renders consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100