conchylicultor <etiennefg....@gmail.com> added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33129>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to