-
-
Notifications
You must be signed in to change notification settings - Fork 490
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
Add more-itertools as a standard package #32100
Comments
comment:3
I'll change my mind about this if it lets us delete a good bit of custom code, but looking at the given examples:
|
comment:5
Replying to @orlitzky:
I agree, there needs to be a demonstrated substantial use before we add another dependency |
comment:6
One example is slicing a list into sublists For that, we can each time define a custom
as found 17 times in We could instead use |
comment:7
Changing that line on its own won't eliminate much code, though. The pattern
is repeated over and over again. If the whole thing were factored out into a helper function, then we'd be left with changing
into
which only saves us a few characters. |
https://pypi.org/project/more-itertools/
Then get rid of our homegrown iteration tools:
sage.misc.misc
:uniq
,_stable_uniq
,subsets
/powerset
Useful:
SequenceView - e.g. gives an idiom for taking the
len
of an iterableonly
/strictly_n
/take
- #34509 comment:52CC: @tscrim @orlitzky @slel @yyyyx4
Component: refactoring
Issue created by migration from https://trac.sagemath.org/ticket/32100
The text was updated successfully, but these errors were encountered: