Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

__dir__() / tab completion returns nonexistent attributes #8613

Closed
mezzarobba opened this issue Mar 26, 2010 · 6 comments
Closed

__dir__() / tab completion returns nonexistent attributes #8613

mezzarobba opened this issue Mar 26, 2010 · 6 comments

Comments

@mezzarobba
Copy link
Member

On the following example, tab completion suggests sum, which is not an attribute of R.

sage: R = QQ['t']
sage: R.su       
R.sum                               R.summation
R.summation_from_element_class_add             
sage: R.sum                                    
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)

/home/marc/co/sage-4.3.4/<ipython console> in <module>()

/home/marc/co/sage-4.3.4/local/lib/python2.6/site-packages/sage/structure/parent.so in sage.structure.parent.Parent.__getattr__ (sage/structure/parent.c:5120)()

/home/marc/co/sage-4.3.4/local/lib/python2.6/site-packages/sage/structure/parent.so in sage.structure.parent.raise_attribute_error (sage/structure/parent.c:2638)()                                                                             

AttributeError: 'PolynomialRing_field' object has no attribute 'sum'
sage: 'sum' in R.__dir__()
True

Component: categories

Reviewer: Simon King

Issue created by migration from https://trac.sagemath.org/ticket/8613

@mezzarobba mezzarobba added this to the sage-4.7 milestone Mar 26, 2010
@williamstein
Copy link
Contributor

comment:1

Notice also that other longer summation_from_element_class_add:

sage: search_src('summation_from_element_class_add')
categories/commutative_additive_semigroups.py:121:        summation_from_element_class_add = summation
categories/commutative_additive_semigroups.py:136:            if (self.summation != self.summation_from_element_class_add) and hasattr(self, "element_class") and hasattr(self.element_class, "_add_parent"):

So, this suggests that this bug has something to do with Nicolas's category theory rewrite? I'll post to sage-combinat.

@williamstein
Copy link
Contributor

comment:2

This issue happens in both the notebook and command line.

@nthiery
Copy link
Contributor

nthiery commented Jun 7, 2010

comment:3

This should be fixed once #9138 will be implemented.

@simon-king-jena
Copy link
Member

comment:5

Indeed, it is a duplicate.

With the patches from #9944 and #9138, one obtains:

sage: R = QQ['t']
sage: R.sum
<bound method PolynomialRing_field_with_category.sum of Univariate Polynomial Ring in t over Rational Field>
sage: R.summ
R.summation                         R.summation_from_element_class_add
sage: R.summation_from_element_class_add
<bound method PolynomialRing_field_with_category.summation of Univariate Polynomial Ring in t over Rational Field>

I learnt: In that case, one should give a ticket a positive review and choose the milestone "duplicate", so that the release manager may close it.

@simon-king-jena
Copy link
Member

Reviewer: Simon King

@simon-king-jena
Copy link
Member

comment:6

PS: #9138 needs review (hint...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants