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

matrix argument parsing eats all the memory instead of rising an error #26928

Closed
sagetrac-tmonteil mannequin opened this issue Dec 20, 2018 · 2 comments
Closed

matrix argument parsing eats all the memory instead of rising an error #26928

sagetrac-tmonteil mannequin opened this issue Dec 20, 2018 · 2 comments

Comments

@sagetrac-tmonteil
Copy link
Mannequin

sagetrac-tmonteil mannequin commented Dec 20, 2018

It has been reported on this ask question, here is a minimal example:

matrix([ZZ])

Component: linear algebra

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

@sagetrac-tmonteil sagetrac-tmonteil mannequin added this to the sage-8.6 milestone Dec 20, 2018
@nbruin
Copy link
Contributor

nbruin commented Dec 21, 2018

comment:1

Why is this a bug? ZZ is an iterable, as you can see from

sage: I=iter(ZZ)
sage: [next(I) for i in [1..10]]
[0, 1, -1, 2, -2, 3, -3, 4, -4, 5]

so the user is asking to construct a matrix with one row and countably infinitely many columns. If there would be a way to tell that an iterator is infinite, we could raise an error, but python does not provide such functionality (thanks to the stopping problem). We can't really do anything about this. It does seem appropriate that matrix accepts an iterable that produces iterables.

@jdemeyer
Copy link

comment:2

I consider this a duplicate of the more general #24757

@jdemeyer jdemeyer removed this from the sage-8.6 milestone Dec 21, 2018
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

2 participants