[Tutor] More or less final Chutes & Ladders

Keith Winston keithwins at gmail.com
Sat Jan 4 13:19:43 CET 2014


Thanks again Denis, I might just have to ruminate on this, but I am
definitely having an allergic reaction.

I understand that Python doesn't have composite objects, but neither does
it dislallow my list of lists of ints and lists... which is, I imagine,
very space efficient. I think what you are in essence saying is that it's a
mistake for me to worry about space at the expense of clarity... ok, but if
I really don't need to break out those single lists ever, to speak of... it
seems like I've vastly enlarged my array for little gain.

I'm not meaning to argue, but to understand. Especially in lieu of an
upcoming project with, perhaps, larger and more complex structures. I am
increasingly curious about whether namedtuples are a good strategy for some
of this: they store their field names, as I understand it, and I can live
with an immutable type in all these cases: I wonder if they are as
efficient in named-field (key) lookup as dictionaries?

I'm also a bit confused here: obviously tuples are immutable, but one can
use lists in them... I think that makes those lists' contents immutable?
And could one define a namedtuple that included lists that were different
lengths for different instantiations (like my game results, for example)? I
really should be playing with them instead of asking questions, at this
point...

Thanks as always!

Keith
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20140104/e5c8f465/attachment-0001.html>


More information about the Tutor mailing list