python-attrs / python-attrs/attrs
kw_only=True in class cannot be overridden by attributes
Open
Nobody has claimed this yet.
Bug
- Dominant language
- Python
- Stars
- 5.8k
- Forks
- 480
- Avg merge
- 2h 15m
- Merged PRs (30d)
- 2
Description
Mostly wondering if this is expected/desired:
import attr
@attr.s(kw_only=True)
class A:
a = attr.ib(kw_only=False)
A(1) # Error
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 running the provided Python reproduction with attrs and inspect how class-level kw_only=True and attribute-level kw_only=False are handled. Review existing tests around keyword-only attributes, then clarify the intended precedence before defining what behavior and test coverage would count as done.
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