[ZODB-Dev] Re: [Zodb-checkins] Changed the strategy for managing savepoints.

Florent Guillaume fg at nuxeo.com
Wed Apr 27 11:16:12 EDT 2005


Jim Fulton  <jim at zope.com> wrote:
> Modified: ZODB/branches/3.4/src/transaction/_transaction.py
> ===================================================================
> --- ZODB/branches/3.4/src/transaction/_transaction.py	2005-04-27 10:18:40 UTC
> (rev 30199)
> +++ ZODB/branches/3.4/src/transaction/_transaction.py	2005-04-27 11:20:56 UTC
> +    # If savepoints are used, keep a weak key dict of them
> +    _savepoints = {}

Isn't it dangerous to have this mutable class attribute? Later on the
code does:

> +        if self._savepoints is None:
> +            self._savepoints = {}
> +        self._savepoints[ref] = self._savepoint_index

And also some dels.

So I'd say you meant to have None for the class attribute
initialization.

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   fg at nuxeo.com


More information about the ZODB-Dev mailing list