Tab Completion Broken in 4.3.2

6 views
Skip to first unread message

Martin Albrecht

unread,
Feb 9, 2010, 3:11:34 PM2/9/10
to Sage Development
Try this:

sage: P.<x,y> = QQ[]
sage: P.<TAB>

Nothing happens, any ideas?

Martin


--
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99
_otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF
_www: http://www.informatik.uni-bremen.de/~malb
_jab: martinr...@jabber.ccc.de

Tom Boothby

unread,
Feb 9, 2010, 3:15:47 PM2/9/10
to sage-...@googlegroups.com
It seems to work for some objects but not others...

sage: P.<x,y> = QQ[]

sage: x.<TAB>

works as expected.

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

David Roe

unread,
Feb 9, 2010, 3:18:25 PM2/9/10
to sage-...@googlegroups.com
K.<a> = GF(9)
K.<TAB>
is also broken.

But it's not just parents:
ZZ.<TAB> works

and it's not just the .<a> syntax:
R.<p> = Qp(5)
R.<TAB> works
David

William Stein

unread,
Feb 9, 2010, 3:36:09 PM2/9/10
to sage-...@googlegroups.com, Nicolas M. Thiery
On Tue, Feb 9, 2010 at 12:18 PM, David Roe <ro...@math.harvard.edu> wrote:
> K.<a> = GF(9)
> K.<TAB>
> is also broken.
>
> But it's not just parents:
> ZZ.<TAB> works
>
> and it's not just the .<a> syntax:
> R.<p> = Qp(5)
> R.<TAB> works
> David

The problem might be the lack of a __dict__ attribute:

sage: P.<x,y> = QQ[]

sage: dir(P)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)

/home/wstein/sage/spkg/standard/<ipysage: P.<x,y> = QQ[]thon console>
in <module>()

/home/wstein/sage/local/lib/python2.6/site-packages/sage/structure/parent.so
in sage.structure.parent.Parent.__dir__
(sage/structure/parent.c:5205)()

/home/wstein/sage/local/lib/python2.6/site-packages/sage/structure/parent.so
in sage.structure.parent.dir_with_other_class
(sage/structure/parent.c:3176)()

/home/wstein/sage/local/lib/python2.6/site-packages/sage/structure/parent.so
in sage.structure.parent.Parent.__getattr__
(sage/structure/parent.c:5138)()
http://trac.sagemath.org/sage_trac/ticket/8223
/home/wstein/sage/local/lib/python2.6/site-packages/sage/structure/parent.so
in sage.structure.parent.raise_attribute_error
(sage/structure/parent.c:2599)()

AttributeError:
'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomialRing_libsingular'
object has no attribute '__dict__'
sage: dir(ZZ)
['Hom', '__an_element', '__call__', '


This is caused by Nick Thiery's patch from trac 7921 which very badly
defines a __dir__ method for parents:

changeset: 13746:6ad207aca83f
user: Nicolas M. Thiery <nth...@users.sf.net>
date: Fri Jan 22 22:53:29 2010 +0100
summary: #7921: Categories for extension types via __getattr___

This is now trac #8223:

http://trac.sagemath.org/sage_trac/ticket/8223

It's critical that we issue a quick Sage-4.3.2.1 bugfix release!

William

Nick Alexander

unread,
Feb 9, 2010, 3:36:41 PM2/9/10
to sage-...@googlegroups.com

On 9-Feb-10, at 12:11 PM, Martin Albrecht wrote:

> Try this:
>
> sage: P.<x,y> = QQ[]
> sage: P.<TAB>

Could you try P.*? <ENTER> If that fails, there might be trouble with
ipython.

Nick

David Roe

unread,
Feb 9, 2010, 3:56:51 PM2/9/10
to sage-...@googlegroups.com
AttributeError: 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomialRing_libsingular' object has no attribute '__dict__'

Looks like William's hypothesis is right.
David

Nicolas M. Thiery

unread,
Feb 9, 2010, 4:05:45 PM2/9/10
to sage-...@googlegroups.com
On Tue, Feb 09, 2010 at 12:36:09PM -0800, William Stein wrote:
> This is caused by Nick Thiery's patch from trac 7921 which very badly
> defines a __dir__ method for parents:

Yup, sorry about that. I knew from the beginning that this
implementation of __dir__, and in particular
sage.structure.parent.dir_with_other_class was not robust. However I
did not expect it to break that early. Suggestions for a better way to
handle this are more than welcome. In the mean time, there is a patch
up on #8223 fixing that particular issue.

Best,
Nicolas
--
Nicolas M. Thi�ry "Isil" <nth...@users.sf.net>
http://Nicolas.Thiery.name/

Reply all
Reply to author
Forward
0 new messages