-
-
Notifications
You must be signed in to change notification settings - Fork 722
enable usage of cache in iterator #35232
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
base: develop
Are you sure you want to change the base?
enable usage of cache in iterator #35232
Conversation
|
@tmller, that's for you! (more coming in another pull request) |
|
We probably should also test this for extension classes (e.g., |
|
There are failures which I have to investigate. The one in |
|
The failure in We do this in a few places: |
|
The failures in The failures in |
|
Does the following look correct? diff --git a/src/sage/combinat/integer_lists/lists.py b/src/sage/combinat/integer_lists/lists.py
index 5143e5cb5e8..0db3ccd27c6 100644
--- a/src/sage/combinat/integer_lists/lists.py
+++ b/src/sage/combinat/integer_lists/lists.py
@@ -166,7 +166,7 @@ class IntegerLists(Parent):
....: lambda n: IntegerListsLex(n, length=1))).list()
[[2], [2]]
"""
- if self.__class__ != other.__class__:
+ if not isinstance(other, IntegerLists):
return False
if self.backend != other.backend:
return False |
|
The problem in diff --git a/src/sage/combinat/shuffle.py b/src/sage/combinat/shuffle.py
index 4c8a9cdd217..a5727312d37 100644
--- a/src/sage/combinat/shuffle.py
+++ b/src/sage/combinat/shuffle.py
@@ -135,7 +135,7 @@ class ShuffleProduct_abstract(Parent):
sage: SP == ShuffleProduct([1,2],[4,5,7])
False
"""
- if not isinstance(other, type(self)):
+ if not isinstance(other, ShuffleProduct_abstract):
return False
return (self._l1 == other._l1 and self._l2 == other._l2) |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## develop #35232 +/- ##
===========================================
+ Coverage 88.57% 88.59% +0.01%
===========================================
Files 2140 2140
Lines 397273 397420 +147
===========================================
+ Hits 351891 352076 +185
+ Misses 45382 45344 -38
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
|
Documentation preview for this PR (built with commit caead99; changes) is ready! 🎉 |
📚 Description
Instead of assigning to
__iter__, we create a local class overriding__iter__. Thus,will now create a cache containing all permutations of 9, which is actually used when iterating over
Permutations(9).Closes #35212
📝 Checklist
⌛ Dependencies
None