[EMAIL PROTECTED] wrote:
> Already thanks for the reply,
> 
> but how to write your own copy operator? Won't you always be passing
> referrences to new_obj?
> 

If you need to modify the behaviour of copy or deepcopy, you can give 
your class __copy__ and __deepcopy__ methods. Then copy.copy and 
copy.deepcopy will use these. As a silly example, you could use:

def __copy__(self):
     raise IOError, 'Permission denied.'

http://www.python.org/doc/2.4.2/lib/module-copy.html
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to