epogrebnyak / abacus

A minimal yet valid double-entry accounting system in Python or command line.
https://epogrebnyak.github.io/abacus/
GNU General Public License v3.0
57 stars 4 forks source link

chain function must not corrupt the argument #62

Closed epogrebnyak closed 9 months ago

epogrebnyak commented 9 months ago

https://github.com/epogrebnyak/abacus/blob/1bd402b8caded7a17fc99699bd9cb780367f26a8/x/test_compose.py#L141-L147

Here is how chain() works:

https://github.com/epogrebnyak/abacus/blob/1bd402b8caded7a17fc99699bd9cb780367f26a8/x/compose.py#L389-L397

I tried both ledger.condense() and ledger.deepcopy() none of them create a copy of ledger as expected.

The expected bevaviout is that after running the chain function the ledger argument is not changed!

epogrebnyak commented 9 months ago

The example can eb run at https://github.com/epogrebnyak/abacus/blob/main/x/using.py