python / python/typeshed

Improve typing of `decorator.decoratorx`

Open
#10,902 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stubs: improvement
Dominant language
Python
Stars
5.1k
Forks
2.1k
Avg merge
1d 19h
Merged PRs (30d)
82

Description

I do not have capacity to open a PR for this, but I would like to suggest the following improvement to decorator.decoratorx which type-checks fine wherever I use it:

class _DecoratorX(Protocol):
    def __call__(
        self, caller: Callable[Concatenate[Callable[_P, _T], _P], _T]
    ) -> Callable[[Callable[_P, _T]], Callable[_P, _T]]: ...

decoratorx: _DecoratorX

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Search the typeshed repository for the declaration of decorator.decoratorx and inspect its surrounding stubs. Compare the current typing with the proposed _DecoratorX protocol, then run the relevant static type checks to confirm the improved annotation works without regressions.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devtools
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.