[ZODB-Dev] oids, numbers, hex and 8-byte strings

Jeremy Hylton jeremy at alum.mit.edu
Tue Oct 25 10:05:17 EDT 2005


On 10/25/05, Chris Withers <chris at simplistix.co.uk> wrote:
> Dieter Maurer wrote:
> >>>    def p64(v):
> >>>        """Pack an integer or long into a 8-byte string"""
> >>
> >>Yes, but for that to be meaningful, you have to know that:
> >>
> >>- 0xSomething is an integer or long (it read "hex number" in my head"
> >>
> >>- oids are 8-byte strings
> >>
> >>Neither of things that sit in my brain :-(
> >
> > But, you knew all this. Otherwise, you would not have been
> > able to implement the "oid_[un]repr" functions.
>
> I didn't implement oid_repr. I traced the code to find that was
> generating the conflict error. I think worked back from that to end up
> with oid_unrepr. The first time I became aware of "p64" was when you
> mentioned it...

http://mail.zope.org/pipermail/zodb-dev/2002-December/004091.html

Perhaps the content of that message just confirms your overall
argument, but you were definitely aware of p64 in the past.  If these
things don't sit in your brain, then it's probably best just to have
reasonable documentation somewhere -- say a Wiki page that explains
the trinity of oid, timestamp, and transaction id and tells you how to
read and write them.

Jeremy


More information about the ZODB-Dev mailing list