Repository navigation
Commit deb9cfc
fix: honor empty-list contract for generator input (#15552)
make_linked_list declared the input as Iterable[int] but tested emptiness
with truthiness, so an empty generator silently produced an empty
LinkedList instead of raising. Materialize the iterable first and cover
generator input with doctests.
Co-authored-by: Christian Clauss <cclauss@me.com>1 parent 6b70b83 commit deb9cfc
1 file changed
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
101 | 107 | | |
| 108 | + | |
102 | 109 | | |
103 | 110 | | |
104 | 111 | | |
| |||
0 commit comments