4 ms·
Shout out to the attrs library. If you find yourself using namedtuple a lot, it's worth considering despite it being an external dependency. https://www.attrs.
by gradys 5y ago
Shout out to the attrs library. If you find yourself using namedtuple a lot, it's worth considering despite it being an external dependency.
https://www.attrs.org/en/stable/ https://www.attrs.org/en/stable/
- re 5y agoData Classes, built into Python since 3.7, are like a somewhat simplified version of the attrs library. I use them in most situations where I would have previously used namedtuple. https://www.python.org/dev/peps/pep-0557/ https://www.python.org/dev/peps/pep-0557/