[ZODB-Dev] oids, numbers, hex and 8-byte strings
Jim Fulton
jim at zope.com
Tue Oct 25 10:07:07 EDT 2005
Jeremy Hylton wrote:
> 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.
While I like wikis for lots of things, in general, I prefer programmer
documentatoon to be managed with the code.
Jim
--
Jim Fulton mailto:jim at zope.com Python Powered!
CTO (540) 361-1714 http://www.python.org
Zope Corporation http://www.zope.com http://www.zope.org
More information about the ZODB-Dev
mailing list