Strange error
bruno at modulix
onurb at xiludom.gro
Thu May 18 10:59:48 EDT 2006
WSobczuk at gmail.com wrote:
> Evaluation of default values seems to have nothing to do with the case
> I described.
It does. Please *read* the faq:
http://pyfaq.infogami.com/why-are-default-values-shared-between-objects
> The default values are both tags = {}, and still inside mysearch() I
> sometimes get some value from previous call inside tags, when the tags
> keyword argument is not specified.
def wtf(foo, args=[]):
args.append(foo)
print args
wtf('???')
wtf('???')
wtf('???')
You didn't post the actual code for mysearch(), but chances are your
code is modifying it !-)
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"
More information about the Python-list
mailing list