Add documentation for annotating descriptors
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
Documentation
Based on the discussions in #2266 and #244, it seems MyPy supports annotations for descriptors, but there doesn't seem to be anything in the documentation about this or how to properly annotate them.
Annotating these isn't obvious, and some best practice for common usages would be helpful.
For example, one common paradigm for generic data descriptors is to return self when called from a class (instance is None), and I'm struggling to find the best way to annotate that.
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 reading discussions #2266 and #244, then inspect the existing documentation structure for the appropriate typing section. Document how descriptors should be annotated, including common generic data-descriptor usage and the class-access case where the descriptor returns itself; done means these patterns and best practices are clearly covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100