I\'m storing a lot of complex data in tuples/lists, but would prefer to use small wrapper classes to make the data structures easier to understand, e.g.
class Pe
In your second example, you only create one object, because tuples are constants.
>>> l = [('foo', 'bar') for i in range(10000000)]
>>> id(l[0])
4330463176
>>> id(l[1])
4330463176
Classes have the overhead, that the attributes are saved in a dictionary. Therefore namedtuples needs only half the memory.