Hi William!

On Dec 1, 12:33 pm, William Stein <[email protected]> wrote:
[...]
> I would call the code in the Sage notebook that is used to *implement*
> tab completion.

If I see correctly, the notebook tab completion is different from the
tab completion on the command line, which can be seen in the following
example:

sage: class FOO:
....:     def __init__(self,x):
....:         self.x = x
....:     def __getattr__(self,s):
....:         print s
....:         return getattr(self.x,s)
....:
sage: foo = FOO(x)
sage: import sagenb.misc.support as s
sage: s.completions('foo.c',globals(),system='python')
__members__
__methods__
trait_names
[]
sage: foo.c<hit tab key>__members__
__methods__
trait_names
_getAttributeNames
}}}

So, the methods of foo called by command line tab completion and
notebook tab completion are different.

In ticket #6854 I provide an attribute __methods__, which makes
introspection work. If I understand correctly, it also makes tab
completion in the notebook work. But for tab completion on the command
line, I implemented _getAttributeNames.

Please comment on the ticket if that approach was stupid.

Cheers,
Simon

-- 
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to