attrs
attrs copied to clipboard
kw_only=True in class cannot be overridden by attributes
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
That’s a good question. It’s inconsistent with other settings where attribute settings always take precedence over class settings. Kw_only is kind of special but probably not special enough to break that contract? 🤔
Let me know if this changes because I'll have to update the mypy plugin. (Currently it's written with the current behavior)
Just wondering if there's still planned support for overriding the class kw_only=True
setting in attributes? I don't think this is supported as of v21.2.0.
“Planned” is a strong word, but a good PR has good chances to get merged.
I think I'll do some brain-storming on this.