I was writing some code the other day, and it needed a quick-and-dirty data 
structure definition for a set of related variables. I looked back at other 
code to try be consistent, and found that I used dataclasses in some parts and 
namedtuples in others. Both seemed the right thing to do at the time - almost 
to the extent where I could change one way for the other and it would still be 
the same code.

You can easily get a dataclass represented as tuple and vice versa. The way 
they work under the hood may be different, but the interfaces are very close. 
Two different modules are doing practically the same thing!
_______________________________________________
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/O2TQG4NBXJOYQABVFCM4Q3G7RDUHIAOU/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to