[ZODB-Dev] Re: getting the object ID (_p_oid attribute)

Benji York benji at zope.com
Mon Jun 26 14:49:36 EDT 2006


Robert Gravina wrote:
> I just tried loading a persisted  
> object interactively and noticed that although the _p_oid doesn't  
> print out as anything (and hence I always thought it was empty in my  
> debugging prints), it isn't actually None! Can anyone explain this?  
> (here "p" is my persisted object)
> 
>  >>> p._p_oid
> '\x00\x00\x00\x00\x00\x00\x00\x08'
>  >>> print p._p_oid
>  >>> p._p_oid is None
> False

What would you expect to see if you printed out seven null characters 
and a backspace?
-- 
Benji York
Senior Software Engineer
Zope Corporation


More information about the ZODB-Dev mailing list