Skip to content

Commit 46b7ec2

Browse files
author
Release Manager
committed
gh-37722: Remove `CombinatorialClass` <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes #12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes #12345". --> - Fixes #36133 - Fixes #33384 - Fixes #19474 - Fixes #12913 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [ ] The title is concise and informative. - [ ] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - #12345: short description why this is a dependency --> <!-- - #34567: ... --> URL: #37722 Reported by: Matthias Köppe Reviewer(s): Martin Rubey, Matthias Köppe, Travis Scrimshaw
2 parents 19b06ac + 094c106 commit 46b7ec2

File tree

10 files changed

+127
-1028
lines changed

10 files changed

+127
-1028
lines changed

src/sage/categories/enumerated_sets.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -990,8 +990,12 @@ def map(self, f, name=None, *, is_injective=True):
990990
....: '_test_enumerated_set_contains',
991991
....: '_test_some_elements'])
992992
"""
993-
from sage.combinat.combinat import MapCombinatorialClass
994-
return MapCombinatorialClass(self, f, name, is_injective=is_injective)
993+
from sage.sets.image_set import ImageSubobject
994+
995+
image = ImageSubobject(f, self, is_injective=is_injective)
996+
if name:
997+
image.rename(name)
998+
return image
995999

9961000
#
9971001
# Consistency test suite for an enumerated set:

src/sage/combinat/all.py

+1-8
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@
5656

5757
from sage.misc.lazy_import import lazy_import
5858

59-
from .combinat import (CombinatorialClass, CombinatorialObject,
60-
MapCombinatorialClass,
59+
from .combinat import (CombinatorialObject,
6160
bell_number, bell_polynomial, bernoulli_polynomial,
6261
catalan_number, euler_number,
6362
fibonacci, fibonacci_sequence, fibonacci_xrange,
@@ -66,12 +65,6 @@
6665
polygonal_number, stirling_number1, stirling_number2,
6766
tuples, unordered_tuples)
6867

69-
lazy_import('sage.combinat.combinat',
70-
('InfiniteAbstractCombinatorialClass', 'UnionCombinatorialClass',
71-
'FilteredCombinatorialClass'),
72-
deprecation=(31545, 'this class is deprecated, do not use'))
73-
74-
7568
from .expnums import expnums
7669

7770
from sage.combinat.chas.all import *

src/sage/combinat/cartesian_product.py

+10
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,16 @@ def iterfunc():
112112
category=category,
113113
cache=False)
114114

115+
def __hash__(self):
116+
r"""
117+
EXAMPLES::
118+
119+
sage: from sage.combinat.cartesian_product import CartesianProduct_iters
120+
sage: cp = CartesianProduct_iters((1,2), (3,4))
121+
sage: hash(cp) == CartesianProduct_iters((1,2), (3,4))
122+
"""
123+
return hash(tuple(self.iters))
124+
115125
def __contains__(self, x):
116126
"""
117127
EXAMPLES::

0 commit comments

Comments
 (0)