Question about references/copies

Henning Kage c0dec at gmx.de
Sat Aug 28 09:52:36 CEST 2004


I'm using Python only for some months now and I'm wondering, whether such
assignments as above are creating bitwise copies of an object or just
recieve a reference. That means I wanted to know, wheter Python in general
differs between references and copies:

class someclass:
  def __init__( self, otherobject):
    self.someattribute = otherobject

And my second question is, whether I should use a cast in such cases or
not (I know, a cast isn't mandatory here...)

Thanks a lot!



More information about the Python-list mailing list