weirdest bug ever

68 views
Skip to first unread message

Martin R

unread,
Mar 9, 2024, 5:22:48 PM3/9/24
to sage-devel
Consider the following innocent definition:

def bug():
    """
    sage: c = bug()
    sage: c.coefficients_mononomials()
    """
    R.<x1, x2, x3> = QQ[]
    p = 20*x1^2 + 20*x1*x2 + 20*x2^2 + 20*x1*x3 + 20*x2*x3 + 20*x3^2
    return Sequence([p])

If I store this in a file "bug.sage" I can do:

sage: load('/home/martin/bug.sage')
sage: c = bug()
sage: c.coefficients_mononomials()
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
...

However, if I use tab-completion in the last line (i.e., to get `coefficients_monomials`), it is found and I obtain the correct result.

Why?  How can I debug this?

Martin

Gareth Ma

unread,
Mar 9, 2024, 5:24:20 PM3/9/24
to 'Martin R' via sage-devel
You typed `mononomials` instead of `monomials`. That's a nono.

Martin R

unread,
Mar 10, 2024, 4:45:55 AM3/10/24
to sage-devel
Oh no! Thank you!
Reply all
Reply to author
Forward
0 new messages