All pastes #93465 Raw Edit

Mine

public text v1 · immutable
#93465 ·published 2006-07-20 13:45 UTC
rendered paste body
>>> import copy
>>>
>>> class A:
...   def __init__ (self, obj=None):
...     if obj:
...       self = copy.copy (obj)
...
>>> a = A()
>>> a.m1 = 10
>>> b = A(a)
>>> b.m1
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
AttributeError: A instance has no attribute 'm1'