Derived class and deepcopy
Philip Smith
as006d4848 at blueyonder.co.uk
Thu Feb 17 00:27:50 EST 2005
Hi
If I derive a class (eg Matrix) from list I presume this implies the classic
OOP 'is a' relation between the derived and super class.
I therefore presume I can use a derived class in any context that I can use
the superclass.
In the given example I want to apply deepcopy() to the Matrix instance (on
initialisation) to ensure that the list part is not affected by subsequent
changes to the initialising list or Matrix but this gives me a string of
errors (some of which imply I'm trying to copy the class rather than the
instance).
Anyone got any thoughts on this????
Phil
More information about the Python-list
mailing list