<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_extra">But most of the time you always have the same attributes in the same order (think of reading a CSV for example), and this would be just a normal tuple, but with custom names for the indexes.</div></div></div></blockquote></div><div><br></div><div>You apparently live in a halcyon world of data cleanliness where CSV data is so well behaved.</div><div><br></div><div>In my world, I more typically deal with stuff like</div><div><br></div><div>data1.csv:</div><div>--------------</div><div>name,age,salaryK</div><div>John,39,50</div><div>Sally,52,37</div><div><br></div><div>data2.csv:</div><div><div>--------------</div></div><div>name,salaryK,age</div><div>Juan,47,31</div><div>Siu,88,66</div><div><br></div><div><br></div><div>I'm likely to define different namedtuples for dealing with this:</div><div><br></div><div>    NameSalAge = namedtuple('NSA','name salary age') </div><div>    NameAgeSal = namedtuple('NAS','name age salary')</div><div><br></div><div>Then later, indeed, I might ask:</div><div><br></div><div>    if employee1.salary == employee2.salary: ...</div><div><br></div><div>And this would work even though I got the data from the different formats.</div><div><br></div><div><br></div>-- <br><div class="gmail_signature">Keeping medicines from the bloodstreams of the sick; food <br>from the bellies of the hungry; books from the hands of the <br>uneducated; technology from the underdeveloped; and putting <br>advocates of freedom in prisons.  Intellectual property is<br>to the 21st century what the slave trade was to the 16th.<br></div>
</div></div>