I'll try to explain through example:<br><span style="font-family:courier new,monospace"><br></span><span style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">==========<span style="font-family:courier new,monospace">==========<span style="font-family:courier new,monospace">==========</span></span></span></span><span style="font-family:courier new,monospace">==========<br>
</span><span style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"></span>In [1]: from lxml import etree<br><br></span><span style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">In [2]: </span>tree = etree.fromstring('<foo><bar></bar></foo>')<br>
</span><span style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">In [3]: </span>xp = tree.xpath('/foo/bar')</span><br><span style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">==========<span style="font-family:courier new,monospace">==========<span style="font-family:courier new,monospace">==========</span></span></span></span><span style="font-family:courier new,monospace">==========</span><br>
<br>Now "xp" is a list of objects, in above example list of just one object:<br><br><span style="font-family:courier new,monospace">[<Element bar at 0x1aa4aa8>]</span><br><br>So if I want to access variable "xp", I must access list item, and IPython treats it as a list without exposing underlying object.<br>
<br>As in:<br><br><span style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">In [4]: </span>xp[0].<tab></span><br><br>it won't let me inspect the object, while if I type:<br>
<br><font face="courier new,monospace">In [5]: xp0 = xp[0]<br>In [6]: xp0.<tab><br><br><span style="font-family:arial,helvetica,sans-serif">Now it exposes the object, and shows me available options/functions.<br><br>
Why is it like this?<br><br>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<br></span></font><br>