Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 7d97a56

Browse files
committed
Partially revert "Allow Sage to work with a system Python 3.6."
This reverts commit abb5607.
1 parent ca088c9 commit 7d97a56

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

src/sage/combinat/subset.py

+4-9
Original file line numberDiff line numberDiff line change
@@ -353,25 +353,20 @@ def cardinality(self):
353353
8
354354
sage: Subsets(3).cardinality()
355355
8
356-
"""
357-
return Integer(1) << self._s.cardinality()
358-
359-
def __len__(self):
360-
r"""
361-
Equivalent to ``self.cardinality()``.
362356
363357
TESTS::
364358
365-
``__len__`` should return a Python int; in Python 3.7+ this happens
366-
automatically, but not on Python 3.6.
359+
``__len__`` should return a Python int.
367360
368361
sage: S = Subsets(Set([1,2,3]))
369362
sage: len(S)
370363
8
371364
sage: type(len(S)) is int
372365
True
373366
"""
374-
return int(self.cardinality())
367+
return Integer(1) << self._s.cardinality()
368+
369+
__len__ = cardinality
375370

376371
def first(self):
377372
"""

src/sage/graphs/views.pyx

-1
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,6 @@ cdef class EdgesView:
626626
elif i < 0:
627627
return list(self)[i]
628628
else:
629-
i = int(i) # For Python < 3.7 where islice doesn't support non-int
630629
try:
631630
return next(islice(self, i, i + 1, 1))
632631
except StopIteration:

0 commit comments

Comments
 (0)