Repository navigation
Avoid mutable defaults in MeltingTemp.py - #2213
Conversation
This also helps with the API documentation presentation, as both epydoc and sphinx would show the dictionary in the function signature (epydoc does abbreviate it).
Codecov Report
@@ Coverage Diff @@
## master #2213 +/- ##
=========================================
+ Coverage 84.69% 84.7% +<.01%
=========================================
Files 317 317
Lines 51448 51456 +8
=========================================
+ Hits 43576 43584 +8
Misses 7872 7872
Continue to review full report at Codecov.
|
MarkusPiotrowski
left a comment
There was a problem hiding this comment.
I wonder why there is no easy way to switch this variable expansion off in autodoc for function headers.
But given that this is the only reasonable way to improve the readability of the API documentation, I agree.
|
There's a flake8 plugin to look for mutable defaults (but only checks for calls, lists, sets, dict), so I don't think it would have caught this: Likewise pylint has dangerous-default-value (W0102), for lists or dicts only: |
|
Applied, thank you Markus. |
In addition to a stylistic improvement (mutable defaults are bad), this pull request addresses an issue noted by @MarkusPiotrowski on #2172:
This also helps with the API documentation presentation, as both epydoc and sphinx would show the dictionary in the function signature (although epydoc does abbreviate it):
https://biopython.org/DIST/docs/api/Bio.SeqUtils.MeltingTemp-module.html#Tm_NN
https://biopython.org/docs/1.74/api/Bio.SeqUtils.MeltingTemp.html#Bio.SeqUtils.MeltingTemp.Tm_NN
I hereby agree to dual licence this and any previous contributions under both
the Biopython License Agreement AND the BSD 3-Clause License.
I have read the
CONTRIBUTING.rstfile, have runflake8locally, andunderstand that AppVeyor and TravisCI will be used to confirm the Biopython unit
tests and style checks pass with these changes.
I have added my name to the alphabetical contributors listings in the files
NEWS.rstandCONTRIB.rstas part of this pull request, am listedalready, or do not wish to be listed. (This acknowledgement is optional.)