- remove several unnecessary comprehensions from functions that accept a generator. - Using `[x for x in iter]` causes a list to be built first then passed to the outer function. - `any` and `all` can take generator instead. This makes memory usage O(1) and actually makes these functions short-circuiting. E.g. if the first condition fails then `all` will immediately return false instead of evaluating all the entries. - `sum`, `min`, `max` => memory usage become O(1) - `list`, `set`, `.join()` => roughly halves memory usage, as list is not required to be built. - lastly, it's two fewer characters to read/think about. |
||
|---|---|---|
| .. | ||
| mariadb | ||
| postgres | ||
| __init__.py | ||
| database.py | ||
| db_manager.py | ||
| schema.py | ||