Commit b3dfe0c
authored
Replace list comprehensions with generators (#11)
By using [generator expressions][0] in `_ProxyWriter.writerow` and
`_ProxyWriter.writerows` instead of [list comprehensions][1], those
methods can avoid loading the entire row or iterable of rows into memory
at once, reducing peak memory consumption.
No tests were written due to the difficulty in asserting the behavior
we're looking for is actually happening.
Fixes #10
[0]: https://docs.python.org/3/glossary.html#term-generator-expression
[1]: https://docs.python.org/3/glossary.html#term-list-comprehension1 parent 2d2d7fb commit b3dfe0c
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
0 commit comments