Derived class and deepcopy

P

Philip Smith

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
 
F

Fredrik Lundh

Philip said:
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????

where's the example? what errors do you get?

</F>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top