On Thu, Apr 28, 2022 at 10:26 PM Ethan Furman <et...@stoneleaf.us> wrote:
> > One thing you can say about dataclasses is that they provide a way to > handle all parameters, mutable and immutable. > > Really? I did not know that. Interesting. > > Definitely an issue of dataclasses being special, though, and not > attributable to the syntax used to make a dataclass. > Absolutely -- my point is that if you want to auto-assign all parameters, then a dataclass is a good way to do it. If you need to write handling code for most parameters, then the current do-it-by-hand approach is fine. A new syntax would help most when you need to write custom code for a few parameters, but auto-assign the rest. I brought up mutable defaults, as they would require custom code, making the auto-assignment a tad less useful. But perhaps if the recent ideas for late-bound parameters ever bears fruit, then combining that with auto-assigning would increase the usefulness of both features. -CHB > > -- > ~Ethan~ > _______________________________________________ > Python-ideas mailing list -- python-ideas@python.org > To unsubscribe send an email to python-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/76GFMSU7OVG3GMFXD52TJFSPG47N2QLR/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/OZXLAM4KBZSGT3HLLXVU5RHDW4JMTQTF/ Code of Conduct: http://python.org/psf/codeofconduct/