python-attrs / python-attrs/attrs
Support for automatic runtime type-checking
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5.8k
- Forks
- 480
- Avg merge
- 2h 15m
- Merged PRs (30d)
- 2
Description
This has been proposed and discussed in https://github.com/python-attrs/attrs/issues/215, as a possible use case for the newly added type argument to attr.ib() #239
quoting @hynek https://github.com/python-attrs/attrs/issues/215#issuecomment-347529479
a good first step would be to add generic class-wide validators (@attr.s(validator=whatever)) and then make type checking a special case of it, possibly with some syntactic sugar.
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 the proposal in issue #215 and the discussion around the newly added type argument to attr.ib() in issue #239. The quoted direction is to consider class-wide validators via @attr.s(validator=whatever) before treating type checking as a special case. Done should include an agreed design and implementation scope for automatic runtime type-checking.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- developer-experience
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100