-
-
Notifications
You must be signed in to change notification settings - Fork 517
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
flatten command for nested lists #395
Comments
comment:2
New version: def flatten(in_list, ltypes=(list, tuple)):
ltypes=(list,
sage.rings.finite_field.FiniteField_prime_modn))
|
comment:3
Sage 2.8.2 has a flatten command. It also seems to work on nested lists:
So am I correct to assume that this ticket can be closed? Cheers, Michael |
comment:4
Yep, this has been in SAGE a while. |
comment:5
This still has some problems on empty lists, which I (Marshall Hampton) will try to fix soon. the simplest example of the problem for the current (2.8.4.1) behavior is: It should return []. |
comment:7
Replying to @sagetrac-mhampton: Sorry, I am not used to this formatting. My example should be: flatten([[],[]]) [[]] |
comment:9
Here is a new version that I believe fixes the problem.
|
comment:12
applied for sage-2.8.4.2. |
The attached file has a candidate function for a flatten command. The default types to flatten are lists and tuples, but more can be added.
Component: basic arithmetic
Keywords: lists, flatten
Issue created by migration from https://trac.sagemath.org/ticket/395
The text was updated successfully, but these errors were encountered: