-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GH-84783: Make the slice object hashable #101264
Conversation
furkanonder
commented
Jan 23, 2023
•
edited by bedevere-bot
Loading
edited by bedevere-bot
- Issue: slice not hashable #84783
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do need to add a NEWS blurb and a versionchanged
entry to the docs.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
We're getting some test failures:
|
It looks like the following test needs to be removed or changed as the expected behaviour would now be a cpython/Lib/test/test_capi/test_misc.py Lines 457 to 460 in b652d40
The following test can probably be modified to reflect the fact that mapping == {1: 'a', 2: 'b', 3: 'c', slice(1, 3, None): 'xy'} is true afterwards: cpython/Lib/test/test_capi/test_misc.py Lines 418 to 421 in b652d40
|
Please correct me if I am wrong, but it looks like cpython/Lib/test/test_doctest.py Line 710 in 3eb12df
len(tests) at 844 ) but debug build adds one to len(tests) (making it 845 ). Looking at the commit history, it looks like it needs modifying every now and then.
@iritkatriel Apologies, but it looks like you were the last to modify this line. Does this sound about right to you? EDIT: I think I've figured it out (below)! |
I think I understand now why On my system, if I clone Now, if I clone your branch, build it normally (non-debug), I get Now, running the tests (on your branch) with non-debug mode succeeds on my system. Once we build with cpython/Lib/test/test_doctest.py Line 710 in 3eb12df
fail. So, I think what needs to be done now is for you to modify that line in >>> 830 < len(tests) < 850 I have verified that For reference: >>> import builtins, doctest
>>> tests = doctest.DocTestFinder().find(builtins) |
Co-authored-by: Owain Davies <116417456+OTheDev@users.noreply.github.com>
* main: (60 commits) pythongh-102056: Fix a few bugs in error handling of exception printing code (python#102078) pythongh-102011: use sys.exception() instead of sys.exc_info() in docs where possible (python#102012) pythongh-101566: Sync with zipp 3.14. (pythonGH-102018) pythonGH-99818: improve the documentation for zipfile.Path and Traversable (pythonGH-101589) pythongh-88233: zipfile: handle extras after a zip64 extra (pythonGH-96161) pythongh-101981: Apply HOMEBREW related environment variables (pythongh-102074) pythongh-101907: Stop using `_Py_OPCODE` and `_Py_OPARG` macros (pythonGH-101912) pythongh-101819: Adapt _io types to heap types, batch 1 (pythonGH-101949) pythongh-101981: Build macOS as recommended by the devguide (pythonGH-102070) pythongh-97786: Fix compiler warnings in pytime.c (python#101826) pythongh-101578: Amend PyErr_{Set,Get}RaisedException docs (python#101962) Misc improvements to the float tutorial (pythonGH-102052) pythongh-85417: Clarify behaviour on branch cuts in cmath module (python#102046) pythongh-100425: Update tutorial docs related to sum() accuracy (FH-101854) Add missing 'is' to `cmath.log()` docstring (python#102049) pythongh-100210: Correct the comment link for unescaping HTML (python#100212) pythongh-97930: Also include subdirectory in makefile. (python#102030) pythongh-99735: Use required=True in argparse subparsers example (python#100927) Fix incorrectly documented attribute in csv docs (python#101250) pythonGH-84783: Make the slice object hashable (pythonGH-101264) ...
* main: (225 commits) pythongh-102056: Fix a few bugs in error handling of exception printing code (python#102078) pythongh-102011: use sys.exception() instead of sys.exc_info() in docs where possible (python#102012) pythongh-101566: Sync with zipp 3.14. (pythonGH-102018) pythonGH-99818: improve the documentation for zipfile.Path and Traversable (pythonGH-101589) pythongh-88233: zipfile: handle extras after a zip64 extra (pythonGH-96161) pythongh-101981: Apply HOMEBREW related environment variables (pythongh-102074) pythongh-101907: Stop using `_Py_OPCODE` and `_Py_OPARG` macros (pythonGH-101912) pythongh-101819: Adapt _io types to heap types, batch 1 (pythonGH-101949) pythongh-101981: Build macOS as recommended by the devguide (pythonGH-102070) pythongh-97786: Fix compiler warnings in pytime.c (python#101826) pythongh-101578: Amend PyErr_{Set,Get}RaisedException docs (python#101962) Misc improvements to the float tutorial (pythonGH-102052) pythongh-85417: Clarify behaviour on branch cuts in cmath module (python#102046) pythongh-100425: Update tutorial docs related to sum() accuracy (FH-101854) Add missing 'is' to `cmath.log()` docstring (python#102049) pythongh-100210: Correct the comment link for unescaping HTML (python#100212) pythongh-97930: Also include subdirectory in makefile. (python#102030) pythongh-99735: Use required=True in argparse subparsers example (python#100927) Fix incorrectly documented attribute in csv docs (python#101250) pythonGH-84783: Make the slice object hashable (pythonGH-101264) ...
Will Bradshaw contributed original patch on bpo-40603. --------- Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
…ble) (python#103146) Will Bradshaw contributed original patch on bpo-40603. --------- Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>