Closed iffy closed 11 years ago
Thanks for reporting this. Can you please post some XML which causes this?
I'm not the original reporter, but do see the same issue with the following XML (TwiML):
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Gather action="http://example.com/calls/1/twiml?event=start" numDigits="1" timeout="0">
<Play>http://example.com/barcall_message_url.wav</Play>
</Gather>
<Redirect>http://example.com/calls/1/twiml?event=start</Redirect>
</Response>
Thank @bsilverthorn, I haven't gone back to that project for a few months.
Untangle does not have a __dir__
. If the expected behavior is to list children names, then this should do it:
def __dir__(self):
children_names = [x._name for x in self.children]
return children_names
If @stchris agrees with this behavior, I can submit a pull request for it.
A sensible default here would be great. As is, IPython throws a stack trace at you whenever you try to tab-complete, which (1) has become ingrained behavior, (2) would be nice for exploring an untangle object while debugging, and (3) seems surprising for new users (e.g., me).
Sorry to jump in so late in this discussion. Of course a pull request for the dir function is welcome. In the meantime I'll try to come up with something useful myself and add some test cases. I'll also test it under IPython/bpython.
I implemented the suggestion from @mipedja, because it seemed sensible to list the list of children. Also tested this with IPython, it seems to work as expected with tab completion.
I'm not sure if this is a SAX problem. If it is, just close it. But here's the problem: