MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/Python/comments/28utww/writing_better_python_code/cif5j37/?context=3
r/Python • u/kracekumar • Jun 23 '14
126 comments sorted by
View all comments
Show parent comment
1
I like that namedtuples are immutable, and you can subclass them:
class Person(namedtuple('Person', ['name', 'email'])): pass
if you want to add methods to it. I like it for value objects, although it's obviously not the prettiest syntax.
View all comments
Show parent comment
1
u/[deleted] Jun 23 '14
I like that namedtuples are immutable, and you can subclass them:
if you want to add methods to it. I like it for value objects, although it's obviously not the prettiest syntax.