This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author conchylicultor
Recipients Prakhar Goel, alan_du, conchylicultor, eric.smith, jimbo1qaz_, pmpp, rhettinger, ryanhiebert, wanderrful, wyz23x2, xtreak
Date 2020-12-16.09:49:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1608112189.03.0.93082886816.issue33129@roundup.psfhosted.org>
In-reply-to
Content
For the API, I think we could add this feature with a single new `dataclass(kw_only: bool | str)`

```
@dataclasses.dataclass(kw_only=True)
class A:
  a: int
  b: int
  c: int

# A(*, a, b, c)


@dataclasses.dataclass(kw_only='b')
class A:
  a: int
  b: int
  c: int

# A(a, *, b, c)
```

I think this would be flexible enough for all use cases, while avoiding the boilerplate from the above proposals.
History
Date User Action Args
2020-12-16 09:49:49conchylicultorsetrecipients: + conchylicultor, rhettinger, eric.smith, pmpp, ryanhiebert, alan_du, xtreak, jimbo1qaz_, wyz23x2, wanderrful, Prakhar Goel
2020-12-16 09:49:49conchylicultorsetmessageid: <1608112189.03.0.93082886816.issue33129@roundup.psfhosted.org>
2020-12-16 09:49:49conchylicultorlinkissue33129 messages
2020-12-16 09:49:48conchylicultorcreate