Tuples vs Lists: Semantic difference (was: Extract String From Enclosing Tuple)

MonkeeSage MonkeeSage at gmail.com
Thu Mar 1 11:43:59 EST 2007


On Mar 1, 5:02 am, bearophileH... at lycos.com wrote:
> I don't know Ruby, but I think it allows such purposes with a freezing
> function.

In ruby all objects can be frozen (freeze is a method on Object, from
which all other objects derive), not just Arrays (Arrays == lists in
python; ruby has no built-in container equiv. to tuple). But that's
more of an implementation detail rather than anthing to do with the
structure/semantics of a certain type of object (e.g., a String can be
frozen, a Hash can be frozen, &c).

Regards,
Jordan




More information about the Python-list mailing list