Unexpected default arguments behaviour (Maybe bug?)
sukkopera at gmail.com
sukkopera at gmail.com
Sun Jul 13 18:29:17 EDT 2008
On 13 Lug, 19:42, marek.ro... at wp.pl wrote:
> I expect it's because default values for parameters are evaluated and
> bound at definition time. So once "def m (self, param = a):" line
> executes, the default value for parameter is forever bound to be 1.
> What you can do is for example:
Yes, that's what I thought, too. Although, it does not seem to me the
correct thing that has to be done, that is why I reported it.
Also thanks for your suggestion, that might work, even though I
already have implemented a workaround (two different methods).
Regards!
More information about the Python-list
mailing list