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 amaury.forgeotdarc
Recipients amaury.forgeotdarc, dominik.holler
Date 2008-09-24.15:58:26
SpamBayes Score 0.01783897
Marked as misclassified No
Message-id <1222271907.75.0.631265896588.issue3958@psf.upfronthosting.co.za>
In-reply-to
Content
Your script is subject to the "shared default value" syndrome, explained
here:
http://www.python.org/doc/faq/general/#why-are-default-values-shared-between-objects

As indicated in the FAQ, your function could be rewritten like this:

def getElementsByAttrib(self, value, AName="ID-REF", list=None):
  if list is None:
      list = []
  ...

to have a less surprising behavior.
History
Date User Action Args
2008-09-24 15:58:27amaury.forgeotdarcsetrecipients: + amaury.forgeotdarc, dominik.holler
2008-09-24 15:58:27amaury.forgeotdarcsetmessageid: <1222271907.75.0.631265896588.issue3958@psf.upfronthosting.co.za>
2008-09-24 15:58:27amaury.forgeotdarclinkissue3958 messages
2008-09-24 15:58:27amaury.forgeotdarccreate