[ZODB-Dev] 0 is not really equal to my object

Derrick Hudson dman at dman13.dyndns.org
Tue Feb 15 14:59:31 EST 2005


On Tue, Feb 08, 2005 at 05:50:06PM -0500, Derrick Hudson wrote:
[...]
| 
| At least I can use "float('inf')" for my sentinel value to work around
| this problem.

Actually, I can't.

        File "lib/python/ZODB/Connection.py", line 416, in commit
            dump(state)
    SystemError: frexp() result out of range

I guess that's to protect people from saving 'inf' on linux then
wondering why they can't load their database on windows (or solaris,
or [other non-GNU-libc system]).


I also learned that I can't use the singleton trick:

    class Infinite:
        ...
    Infinite = Infinite()

because the ZODB stores the classname of the instance, and then tries
to find the class from the name when unpickling it.


I reduced my sentinel value down to a basic string, and
procedural-style "if" blocks in the code that must handle it.


Maybe this message in the archives will help the the next person who
comes up with these ideas.


BTW, thanks for all the info regarding ZODB 3.2 and 3.3 compatibility.
I will keep it in mind to use when it is time to upgrade.

-D

-- 
The wise in heart are called discerning,
and pleasant words promote instruction.
        Proverbs 16:21
 
www: http://dman13.dyndns.org/~dman/            jabber: dman at dman13.dyndns.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zodb-dev/attachments/20050215/3e5bbad9/attachment.bin


More information about the ZODB-Dev mailing list