Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Python's `sum` starts with a 0, and then adds each element in turn. So previously this would fail with ```python >>> sum(model.metabolites.etoh_c.reactions) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: unsupported operand type(s) for +: 'int' and 'Reaction' ``` 1) Allow an `__radd__` function and 2) Explicitly allow `reaction + 0` So now you can ```python >>> sum(model.metabolites.etoh_c.reactions).reaction 'etoh_e + h_e + nad_c <=> acald_c + 2.0 h_c + nadh_c' ```
- Loading branch information