You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The getattr hack of #7921 to let extension types "inherit" from category does not fail graciously on descriptors.
Visible effect: tab completion is broken under emacs:
sage: n=1
sage: n.<tab> # gives nothing
This is a variant of #8223. Emacs does not use dir straight away, but instead calls _ip.IP.magic_psearch which is conservative and does not trust dir. So it actually tries to get all advertised attributes, and in particular the descriptor __weakref__ which failed on 1 and confused getattr.
The attached patch makes the getattr fail graciously in such situations. It probably would be better for __weakref__ to not appear in dir in the first place, but at least this should fix the bug and variants thereof.
Again, better implementations of the getattr hack are most welcome. See comments in the code.
nthiery
changed the title
tab completion broken in emacs
getattr hack not failing graciously on descriptors / tab completion broken in emacs
Feb 17, 2010
The getattr hack of #7921 to let extension types "inherit" from category does not fail graciously on descriptors.
Visible effect: tab completion is broken under emacs:
This is a variant of #8223. Emacs does not use dir straight away, but instead calls _ip.IP.magic_psearch which is conservative and does not trust dir. So it actually tries to get all advertised attributes, and in particular the descriptor
__weakref__
which failed on 1 and confused getattr.The attached patch makes the getattr fail graciously in such situations. It probably would be better for
__weakref__
to not appear in dir in the first place, but at least this should fix the bug and variants thereof.Again, better implementations of the getattr hack are most welcome. See comments in the code.
CC: @sagetrac-sage-combinat
Component: misc
Keywords: tab completion, dir, getattr
Author: Nicolas M. Thiéry
Reviewer: Mike Hansen
Merged: sage-4.3.4.alpha1
Issue created by migration from https://trac.sagemath.org/ticket/8296
The text was updated successfully, but these errors were encountered: