Skip to content

Conversation

@PGijsbers
Copy link
Collaborator

Sometime between 3.9 and 3.12 the stringification of ordered dicts changed from using a list of tuples to a dictionary.


was setting a new environment and noticed this little change (apparently 3.11->3.12):

➜  omlp git:(fix/regex) ✗ pyenv shell 3.12
➜  omlp git:(fix/regex) ✗ python -c "from collections import OrderedDict; print(OrderedDict(a=2))"
OrderedDict({'a': 2})
➜  omlp git:(fix/regex) ✗ pyenv shell 3.11
➜  omlp git:(fix/regex) ✗ python -c "from collections import OrderedDict; print(OrderedDict(a=2))"
OrderedDict([('a', 2)])

Sometime between 3.9 and 3.12 the stringification of
ordered dicts changed from using a list of tuples to
a dictionary.
@PGijsbers PGijsbers added bug maintenance & CI Continuous integration & package distribution labels Sep 26, 2024
@codecov-commenter
Copy link

codecov-commenter commented Sep 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.28%. Comparing base (07e9b9c) to head (8ded99f).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1353   +/-   ##
========================================
  Coverage    84.28%   84.28%           
========================================
  Files           38       38           
  Lines         5288     5288           
========================================
  Hits          4457     4457           
  Misses         831      831           
Flag Coverage Δ
84.28% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@eddiebergman eddiebergman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, interesting behavioural change, wonder what their motivation for the change was?

@PGijsbers
Copy link
Collaborator Author

If I had to guess, it's because of the 3.6 implementation/3.7 spec change to dictionaries where they are now ordered by default. For old representations a list made more sense since that was always ordered. I wonder if they missed this earlier or it has something to do with internal deprecation cycles or something, but I imagine it has to be related to that.

@PGijsbers PGijsbers merged commit 7764ddb into develop Sep 27, 2024
@PGijsbers PGijsbers deleted the fix/regex branch September 27, 2024 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug maintenance & CI Continuous integration & package distribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants