[Tutor] Tuple (Section 9.3)

Hugo González Monteverde hugonz at h-lab.net
Tue Apr 11 18:08:46 CEST 2006


Hi Kaushal,

I might have to do a little guessing and see what is not clear from the 
explanation.

The whole point of returning a tuple as opposed to, say, returning a 
list, is the fact that  tuples are NON mutable. That is, *apparently* 
you would not be returning a reference, but the values themselves.

There is no better example I can think of, than the one you already 
read. If you want a function tu return multiple parameters so that you 
can do.

ret1, ret2 = func()

then have func return a tuple. That's the whole point of the chapter you 
read.

Maybe there is too much information in the discussion that does not look 
useful to you if you have not run into a problem where you need it.

I hope this is not some kind of homework :)

Hugo


More information about the Tutor mailing list