[Zope-dev] ZODB object upgrades

Dieter Maurer dieter at handshake.de
Wed Nov 5 16:43:29 EST 2003


alan milligan wrote at 2003-11-2 14:13 +0000:
 > ...
 > I now desperately need to write a parser to convert all of these nasties to 
 > ZCurrency types.   I've come up with the following ExternalMethod - whereby 
 > I've defined a __currency__ attribute in each obselete incantation's product 
 > ...
 > def repair(container, counter=0):
 > ...
 >                 counter += 1
 > ...
 >             repair(object, counter)
 >     return counter
 > ...
 > However, it doesn't seem to find anything to convert.  Does anyone have any 
 > ideas?

"counter" is an integer and integers are immutable.
Therefore, "counter += 1" does not change the integer object
but assigns a new one to "counter". This change is local to
the "repair" incarnation. The "counter" in the caller is not changed.

-- 
Dieter



More information about the Zope-Dev mailing list