subclassing tuple

Terry Reedy tjreedy at udel.edu
Wed Sep 18 00:31:21 CEST 2002


"Douglas Zongker" <dougz at cs.washington.edu> wrote in message
news:H2LMGE.1JBF at beaver.cs.washington.edu...
> I could do this with lists instead, but that means changing a lot of
> existing code that expects tuples (and I don't want these objects to
> be mutable!)

You might get what you want by starting with a list, doing your custom
modifications, and then 'return tuple(mylist)' or subclass thereof.

TJR





More information about the Python-list mailing list