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

Unable to compute limit() over a variable coming from a list #38761

Open
2 tasks done
maxale opened this issue Oct 3, 2024 · 0 comments
Open
2 tasks done

Unable to compute limit() over a variable coming from a list #38761

maxale opened this issue Oct 3, 2024 · 0 comments
Labels

Comments

@maxale
Copy link
Contributor

maxale commented Oct 3, 2024

Steps To Reproduce

Consider an example:

sage: x = var('x',n=3)
sage: f = sum(x); f
x0 + x1 + x2
sage: f.limit(x[1]=1)
  Cell In[3], line 1
    f.limit(x[Integer(1)]=Integer(1))
            ^
SyntaxError: expression cannot contain assignment, perhaps you meant "=="?

sage: f.limit(x[1]==1)
[...]
ValueError: call the limit function like this, e.g. limit(expr, x=2).

Expected Behavior

It should be possible to computing limit without confusing its argument with an assignment. It'd would be much safer to have an interface like .limit(x[1], 1), where the variable and its value are separated.

Actual Behavior

Sage thinks x[1]=1 is an assignment and gives an error.

Additional Information

I was able to compute the limit via the following very roundabout way:

sage: f.limit(**{str(x[1]):1})
x0 + x2 + 1

Environment

  • OS: Ubuntu 24.04.1 LTS
  • Sage Version: 10.5.beta6

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide
@maxale maxale added the t: bug label Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant