On Mon, 12 Jan 2009 17:32:05 -0600
"Edward K. Ream" <[email protected]> wrote:

> On Mon, Jan 12, 2009 at 10:28 AM, Terry Brown
> >
> > Can you explain again what's wrong with the if not stack: return
> > None approach?
> 
> top-level positions have an empty stack.

Ok - but assuming the code works for top level positions (it should,
right?) it still doesn't make sense to pop from an empty list and raise
an exception.  Unless by toplevel position you mean the root node, I've
been assuming you mean a child of the root node.

> Take a look at p.__nonzero__ and p.__bool__.  The proper test is
> against p.v, not p.stack.

My goal here again is to get a useful response when I ask for the
position for a vnode *for which there is no position*.

This is after all a method to find the position of a vnode, if
possible.  Nothing to stop the plugin holding a reference to a vnode
that's been deleted.

> Rather than returning None, you could return c.nullPosition().

Ok, but I still have the stack problem :)

Cheers -Terry

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to