[Zope] Persistent variable in Python Script? Is this a feature or a bug?

iap@y2fun.com iap@y2fun.com
Tue, 9 Apr 2002 16:03:50 +0800


Given a Python Script A which only returns an array
========
return ('a')
========

Then call A in another Python Script B with parameter list: b=[]

========
b.append(container.A())
return b
========

Then request B in browser. Guess what happened?
['a']
correct!
But what if you "reload" B again and again?
You will get
['a','a','a',........]

Well, why this happen? A feature  or  A bug?
I thought that the parameter should be cleared at each new request.
How to get a "local" parameter without this persistent feature?

Any idea? Thanks a lot.

Iap, Singuan