[Tutor] Variable Modification in a class

Tom Jenkins tjenkins@devis.com
Tue Jun 3 12:16:02 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mehta, Anish wrote:
| Your point looks to me very right but the problem still remains the
| same. The output is still
| 30 40
| 30 40
|
| May be i am making some mistake here again.
|
| class AB:
|    def __init__(self):
|        self.a = None
|        self.b = None
|
| def func(ab):
[snip]
|    c = b
[snip]

as i said in my other email, at this point in your function, you are
again assigned c to reference whatever instance b is referencing.
remove that line.

- --
Tom Jenkins
devIS - Development Infostructure
http://www.devis.com

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.0-nr2 (Windows XP)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE+3MjmV7Yk9/McDYURAtKtAJ9r6SVx1ogRNC6JYImOFYTpjfI6YgCgyIoK
nwISsAkLOiHwnpUihbyngrs=
=MqQv
-----END PGP SIGNATURE-----