homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author SukkoPera
Recipients SukkoPera
Date 2008年07月18日.08:41:33
SpamBayes Score 0.02782279
Marked as misclassified No
Message-id <1216370496.76.0.890911123017.issue3403@psf.upfronthosting.co.za>
In-reply-to
Content
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 GNU/Linux.
There has been a short discussion about this at
http://groups.google.it/group/comp.lang.python/browse_thread/thread/9f740eea131e7ef2/56fd4e120a069a1d#56fd4e120a069a1d.
History
Date User Action Args
2008年07月18日 08:41:37SukkoPerasetspambayes_score: 0.0278228 -> 0.02782279
recipients: + SukkoPera
2008年07月18日 08:41:36SukkoPerasetspambayes_score: 0.0278228 -> 0.0278228
messageid: <1216370496.76.0.890911123017.issue3403@psf.upfronthosting.co.za>
2008年07月18日 08:41:35SukkoPeralinkissue3403 messages
2008年07月18日 08:41:34SukkoPeracreate

AltStyle によって変換されたページ (->オリジナル) /