[Zope] Reverse-resolve hex instance numbers in traceback?
Dylan Reinhardt
zope at dylanreinhardt.com
Wed Oct 8 14:52:03 EDT 2003
On Wed, 2003-10-08 at 04:53, Milos Prudek wrote:
> > Sure... you *can* get the address of an object by getting the string
> > representation of it using backticks, ex:
> >
> > `my_obj`
>
> So, for example, I can do the following?
>
> print `<Folder instance at 89ca148>`
>
> Is that what you mean?
>
No, it wasn't. Backticks cause an object to be represented as a
string. Typically this operator produces a string of the form:
<CLASS_NAME instance at HEX_ADDR>
The backticks themselves go around the object name. To take your
example: (note ticks on the name, single quotes on the string)
`my_folder_name` might return '<Folder instance at 89ca148>'
What I was suggesting is that it is *possible* (though not necessarily
useful) to iterate over a collection of objects and test each one's
string representation to see if it matches the hex address you already
have. When you find a match, you print the object's id.
But as I also mentioned, a far smarter thing is to test each object for
the specific attributes that you think are missing. That process will
ultimately be much more useful.
HTH,
Dylan
More information about the Zope
mailing list