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

Commit

Permalink
Partially revert "Allow Sage to work with a system Python 3.6."
Browse files Browse the repository at this point in the history
This reverts commit abb5607.
  • Loading branch information
tobiasdiez committed Dec 7, 2020
1 parent ca088c9 commit 7d97a56
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
13 changes: 4 additions & 9 deletions src/sage/combinat/subset.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,25 +353,20 @@ def cardinality(self):
8
sage: Subsets(3).cardinality()
8
"""
return Integer(1) << self._s.cardinality()

def __len__(self):
r"""
Equivalent to ``self.cardinality()``.
TESTS::
``__len__`` should return a Python int; in Python 3.7+ this happens
automatically, but not on Python 3.6.
``__len__`` should return a Python int.
sage: S = Subsets(Set([1,2,3]))
sage: len(S)
8
sage: type(len(S)) is int
True
"""
return int(self.cardinality())
return Integer(1) << self._s.cardinality()

__len__ = cardinality

def first(self):
"""
Expand Down
1 change: 0 additions & 1 deletion src/sage/graphs/views.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,6 @@ cdef class EdgesView:
elif i < 0:
return list(self)[i]
else:
i = int(i) # For Python < 3.7 where islice doesn't support non-int
try:
return next(islice(self, i, i + 1, 1))
except StopIteration:
Expand Down

0 comments on commit 7d97a56

Please sign in to comment.