-
-
Notifications
You must be signed in to change notification settings - Fork 409
Closed
Description
It would be nice to support keyword-only constructor parameters, e.g.
@attr.s
class A:
a = attr.ib()
b = attr.ib(keyword=True)
A(1, 2) # forbidden
A(1, b=2) # passed
Should be allowed for Python 3 only.
Well, attrs should have no Python 3 specific code -- compilation of __init__ function with keyword-only arguments generates SyntaxError on Python 2, maybe enough.
I don't know what name is better: keyword, kw_only, keyword_only.
Metadata
Metadata
Assignees
Labels
No labels