bpo-34839: Add a 'before 3.6' in the section 'warnings' of doctest by matrixise · Pull Request #9736 · python/cpython
matrixise
changed the title
Add a 'before 3.6' in the section 'warnings' of doctest
bpo-34839: Add a 'before 3.6' in the section 'warnings' of doctest
| guarantee that the key-value pairs will be printed in any particular order, so a | ||
| test like :: | ||
| guarantee about output. For example, before Python 3.6, when printing a dict, | ||
| Python did not guarantee that the key-value pairs was printed in any |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Plural: pairs were printed
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As Raymond noted on BPO, it's still the case that nothing about the display order of sets is defined. So probably better to change the example to use a set of strings instead, and add a note about how the same kinds of things were required for dicts too before 3.6.
| guarantee that the key-value pairs will be printed in any particular order, so a | ||
| test like :: | ||
| guarantee about output. For example, when printing a set, Python doesn't | ||
| guarantee that the key is printed in any particular order, so a test like :: |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use elements in place of key, for members of a set.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concur with Julien. Members of a set are "elements"
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| guarantee that the key-value pairs will be printed in any particular order, so a | ||
| test like :: | ||
| guarantee about output. For example, when printing a set, Python doesn't | ||
| guarantee that the key is printed in any particular order, so a test like :: |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concur with Julien. Members of a set are "elements"
| {"Hermione", "Harry"} | ||
|
|
||
| is vulnerable! One workaround is to do :: | ||
| was vulnerable! One workaround is to do :: |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe keep is here? Since sets are still unordered?
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool thank you and fixed
Hi @rhettinger
I have fixed this PR, when you have time, could you check this PR?
Thank you,
Have a nice day,
@rhettinger once you will accept this PR, we could close the issue. ;-)
Thanks
Thanks @matrixise for the PR, and @JulienPalard for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request
Apr 12, 2019…ythonGH-9736) (cherry picked from commit 0522fd8) Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
miss-islington added a commit that referenced this pull request
Apr 12, 2019This 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