[issue40796] dataclasses.make_dataclass: Exception when called with different field orders

2020-05-27 Thread Darrick Yee
Darrick Yee added the comment: Yes, that makes sense. Thank you! On Wed, May 27, 2020, 1:40 PM Eric V. Smith wrote: > > Eric V. Smith added the comment: > > No problem! > > It can't reorder fields, because you might not be passing them by name. > There's

[issue40796] dataclasses.make_dataclass: Exception when called with different field orders

2020-05-27 Thread Darrick Yee
Darrick Yee added the comment: TypeError: non-default argument 'field1' follows default argument You are right. For some reason I believed it would automatically gather the required fields first when creating the new class&

[issue40796] dataclasses.make_dataclass: Exception when called with different field orders

2020-05-27 Thread Darrick Yee
Change by Darrick Yee : -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue40796> ___ ___ Python-bugs-list

[issue40796] dataclasses.make_dataclass: Exception when called with different field orders

2020-05-27 Thread Darrick Yee
New submission from Darrick Yee : https://docs.python.org/3/library/dataclasses.html#module-dataclasses `make_dataclass` takes a `field` parameter, which is an iterable whose entries may be tuples of `(name, type)` or `(name, type, dataclasses.Field)`. However, an exception is thrown if