Re: [Python-ideas] Python 3.7 dataclasses attribute order

2018-10-24 Thread Eric V. Smith
On 10/24/2018 5:30 AM, Anders Hovmöller wrote: Well that seems super unfortunate. You can opt out of the auto generate constructor and do it yourself:   @dataclass(init=False)   class Foo:       foo: str       bar: str = None       baz: str       def __init__(self, *, foo, bar = None,

Re: [Python-ideas] Python 3.7 dataclasses attribute order

2018-10-24 Thread Anders Hovmöller
Well that seems super unfortunate. You can opt out of the auto generate constructor and do it yourself: @dataclass(init=False) class Foo: foo: str bar: str = None baz: str def __init__(self, *, foo, bar = None, baz): self.foo = foo self.bar = bar