Skip to content

Commit acbc72c

Browse files
author
Release Manager
committed
gh-39827: fix random doctest error in `src/sage/data_structures/bitset.pyx` Fixes #39826. Bitset cannot be build from an empty list. We change the doctest to pass lists with at least 1 element. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] 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 and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - #12345: short description why this is a dependency --> <!-- - #34567: ... --> URL: #39827 Reported by: David Coudert Reviewer(s): Frédéric Chapoton
2 parents 327eb34 + f23ecb4 commit acbc72c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/sage/data_structures/bitset.pyx

+2-2
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ cdef class FrozenBitset:
164164
165165
Try a random bitset::
166166
167-
sage: a = Bitset(randint(0, 1) for n in range(1, randint(1, 10^4)))
167+
sage: a = Bitset(randint(0, 1) for n in range(randint(1, 10^4)))
168168
sage: b = FrozenBitset(a); c = FrozenBitset(b)
169169
sage: bitcmp(a, b, c)
170170
True
@@ -239,7 +239,7 @@ cdef class FrozenBitset:
239239
240240
A random iterable, with all duplicate elements removed::
241241
242-
sage: L = [randint(0, 100) for n in range(1, randint(1, 10^4))]
242+
sage: L = [randint(0, 100) for n in range(randint(1, 10^4))]
243243
sage: FrozenBitset(L) == FrozenBitset(list(set(L)))
244244
True
245245
sage: FrozenBitset(tuple(L)) == FrozenBitset(tuple(set(L)))

0 commit comments

Comments
 (0)