On 12/13/06, William Stein <[EMAIL PROTECTED]> wrote:

> (2) I'm against syntactic parsing to do tab completion.  However,
> I'm open to the possibility of having the tab complete function
> work on any syntatically correct expression (for which eval works).

A small comment in this direction: ipython used to have completion
that would work on things like

foo[1].<TAB>

by using eval().  I quickly learned that eval() should be avoided AT
ALL COSTS for the purposes of tab completion, because of the potential
for side effects.  I started getting bug reports from people with
generators in their code which were getting consumed: the eval() in
the completion would eat one iteration of the generator before the
actual execution of the code (when the person hits ENTER).

If you poke around the completion code in ipython today, you'll find
that I've reduced the places where eval() or exec is called to an
absolute minimum, to try and avoid as many of these problems as I can.

Just some comments from someone who's been burned already :)

Cheers,

f

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to