Repository navigation
Assume dict is ordered - #2518
Conversation
This is a language feature in Python 3.7 onwards. This is behaviour in CPython 3.6 and the PyPy implementation of Python 3.6. We are not currently aware of any other Python 3.6 implementation (where dictionaries might not be sorted), so this is simpler now that we require at least Python 3.6 for Biopython.
|
Is it worth updating the docstrings? e.g. biopython/Bio/SeqIO/__init__.py Lines 762 to 768 in 883ebfd Could also add a note about the equality testing I mentioned in the issue (order sensitive with |
Thanks Chris Rands, spotted in review.
Codecov Report
@@ Coverage Diff @@
## master #2518 +/- ##
==========================================
+ Coverage 84.76% 84.77% +<.01%
==========================================
Files 321 321
Lines 52381 52368 -13
==========================================
- Hits 44403 44394 -9
+ Misses 7978 7974 -4
Continue to review full report at Codecov.
|
|
Good spot @chris-rands - How's this for the docstring? Or simplify further, and just say record order is preserved in the dictionary? |
|
Looks good, the docstring similar in biopython/Bio/SearchIO/__init__.py Lines 405 to 411 in 632acdf |
Again, spotted by Chris Rands in review
Partly addresses #2490, where this was discussed.
Ordered dictionaries are a language feature in Python 3.7 onwards, but we currently support Python 3.6 onwards.
Thankfully the only major implementations of Python 3.6 we are aware of (CPython and PyPy) both implement ordered dictionaries.
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.)