[IPython-User] Question about object introspection
Sat Sep 22 07:42:42 CDT 2012
I'll try to explain through example:
In : from lxml import etree
In : tree = etree.fromstring('<foo><bar></bar></foo>')
In : xp = tree.xpath('/foo/bar')
Now "xp" is a list of objects, in above example list of just one object:
[<Element bar at 0x1aa4aa8>]
So if I want to access variable "xp", I must access list item, and IPython
treats it as a list without exposing underlying object.
In : xp.<tab>
it won't let me inspect the object, while if I type:
In : xp0 = xp
In : xp0.<tab>
Now it exposes the object, and shows me available options/functions.
Why is it like this?
I guess I miss something and there must be some issue with it if it's made
like this, but I can't think of it
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-User