[BUGFIX] Remove Mutable Default Arguments#19
Open
johnjameswhitman wants to merge 1 commit intointerfax:masterfrom
Open
[BUGFIX] Remove Mutable Default Arguments#19johnjameswhitman wants to merge 1 commit intointerfax:masterfrom
johnjameswhitman wants to merge 1 commit intointerfax:masterfrom
Conversation
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 .................. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
InterFAXclient 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.