Hi, I have just encountered a Python behaviour I wouldn't expect. Take
the following code:

------------------------------------------------------------------------
class Parent:
        a = 1

        def m (self, param = a):
                print "param = %d" % param

class Child (Parent):
        a = 2


p = Parent ()
p.m ()

c = Child ()
c.m ()
------------------------------------------------------------------------

I would expect to receive the following output:
param = 1
param = 2

But actually I get:
param = 1
param = 1

Is this the correct behaviour, and then why, or is it a bug? For
reference, I am using Python 2.5.1 on UNIX.

Thanks in advance!
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to