Skip to content

Conversation

johnjameswhitman
Copy link

@johnjameswhitman johnjameswhitman commented May 16, 2024

Problem

We use this client and are debugging some stuff on our end. While tracing the code I noticed there are mutable default arguments for a few methods in the InterFAX client class, which can have some nasty surprises:
https://docs.python-guide.org/writing/gotchas/

Solution

Switch over to immutable default and populate with the corresponding list or dictionary as needed.

@johnjameswhitman johnjameswhitman changed the title [BUGFIX] Remove Mutable Defaults Arguments [BUGFIX] Remove Mutable Default Arguments May 16, 2024
@johnjameswhitman
Copy link
Author

Ran tests locally after making the change...

$ PYTHONPATH=. pytest tests
========================================================= test session starts ==========================================================
platform darwin -- Python 3.9.19, pytest-3.0.2, py-1.11.0, pluggy-0.3.1
rootdir: /Users/jwhitman/projects/third_party/github.com/johnjameswhitman/interfax-python, inifile: setup.cfg
collected 64 items

tests/test_account.py ..
tests/test_client.py ................
tests/test_documents.py ......
tests/test_files.py ......
tests/test_inbound.py .......
tests/test_outbound.py .........
tests/test_response.py ..................

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant