westonplatter / ledgerx-python

Client for the LedgerX exchange (BTC and ETH derivatives)
BSD 3-Clause "New" or "Revised" License
5 stars 4 forks source link

(PYL-W0102) Dangerous default argument #8

Open westonplatter opened 3 years ago

westonplatter commented 3 years ago

Description

Do not use a mutable like list or dictionary as a default value to an argument. Python’s default arguments are evaluated once when the function is defined. Using a mutable default argument and mutating it will mutate that object for all future calls to the function as well.

Occurrences

There are 15 occurrences of this issue in the repository.

See all occurrences on DeepSource → deepsource.io/gh/westonplatter/ledgerx-python/issue/PYL-W0102/occurrences/

westonplatter commented 3 years ago

Possible method for fixing, https://docs.quantifiedcode.com/python-anti-patterns/correctness/mutable_default_value_as_argument.html