Repository navigation
Commit f1c37e3
committed
fix: honor empty-list contract for generator input
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.1 parent 215c1f0 commit f1c37e3
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