This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Minor inaccuracy in hash documentation
Type: behavior Stage: resolved
Components: Documentation Versions: Python 3.6, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: mark.dickinson Nosy List: abarry, berker.peksag, docs@python, magniff, mark.dickinson, python-dev, r.david.murray
Priority: normal Keywords: patch

Created on 2016-07-23 18:17 by magniff, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
hash_complex_typo_1.patch abarry, 2016-07-23 18:49 review
hash_doc_renamed_1.patch abarry, 2016-07-23 18:50 review
Messages (11)
msg271097 - (view) Author: Aleksandr Koshkin (magniff) Date: 2016-07-23 18:17
https://docs.python.org/3.6/library/stdtypes.html#hashing-of-numeric-types
Look at semantics example for hash_complex function. The variable 'hash' is clearly misused - it is not defined or refers to builtin function 'hash'. Either way the example is incorrect.
msg271099 - (view) Author: Aleksandr Koshkin (magniff) Date: 2016-07-23 18:25
Moreover this example contains following code
if hash_ == -1:
   hash_ == -2
return hash_
that doesn`t make too much sense.
msg271100 - (view) Author: Anilyka Barry (abarry) * (Python triager) Date: 2016-07-23 18:49
Indeed, nicely spotted! Patch attached (hash_complex_type_1.patch)

P.S.: I don't like the 'hash_' name as a variable for this example; it  looks like grit on Tim's monitor to me, so I went ahead and renamed it to 'hash_value' in that block. Attached as a separate patch for good measure (hash_doc_renamed_1.patch)
msg271102 - (view) Author: Aleksandr Koshkin (magniff) Date: 2016-07-23 19:03
Thanks)
msg271104 - (view) Author: Anilyka Barry (abarry) * (Python triager) Date: 2016-07-23 19:34
Do note that nothing has been changed in the docs yet. I submitted the patch, and now other developers need to review it, decide whether it's correct or need modifications, and then someone needs to commit it. Let the bikeshedding start =)
msg271107 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2016-07-23 20:20
Adding a _ after a keyword is a very common trick.  The fact that one got lost indicates that it isn't necessarily optimal :).  I don't really have an opinion one way or the other on the variable rename.
msg271109 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2016-07-23 20:24
The changes look good to me. Thanks for spotting this!
msg271203 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-07-25 01:56
New changeset a6be689eacf8 by Berker Peksag in branch '3.5':
Issue #27601: Improve example in the "Hashing of numeric types" section
https://hg.python.org/cpython/rev/a6be689eacf8

New changeset 06bbcbaeeb18 by Berker Peksag in branch 'default':
Issue #27601: Merge from 3.5
https://hg.python.org/cpython/rev/06bbcbaeeb18
msg271204 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2016-07-25 01:58
Looks good to me too. 'hash_value' looks more readable to me, thanks!
msg271208 - (view) Author: Aleksandr Koshkin (magniff) Date: 2016-07-25 02:22
Originally I emphasized that this bug occurs at every py3k version since 3.2. For some reason version list somehow shrinked to only tow of them - 3.5 and 3.6. I am very sorry, this is probably my fault.
msg271212 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2016-07-25 02:31
> I am very sorry, this is probably my fault.

It's not your fault :) I removed them.

3.2, 3.3 and 3.4 are in security-fix-only mode so they won't get any documentation updates. You can read https://docs.python.org/devguide/devcycle.html#secbranch for details about security branches.

Thanks for the report!
History
Date User Action Args
2022-04-11 14:58:34adminsetgithub: 71788
2016-07-25 02:31:44berker.peksagsetstatus: open -> closed
resolution: fixed
messages: + msg271212

versions: - Python 3.2, Python 3.3, Python 3.4
2016-07-25 02:22:00magniffsetstatus: closed -> open
resolution: fixed -> (no value)
messages: + msg271208

versions: + Python 3.2, Python 3.3, Python 3.4
2016-07-25 01:58:16berker.peksagsetstatus: open -> closed

type: behavior
versions: - Python 3.2, Python 3.3, Python 3.4
nosy: + berker.peksag

messages: + msg271204
resolution: fixed
stage: patch review -> resolved
2016-07-25 01:56:17python-devsetnosy: + python-dev
messages: + msg271203
2016-07-23 20:24:11mark.dickinsonsetmessages: + msg271109
2016-07-23 20:20:13r.david.murraysetnosy: + r.david.murray
messages: + msg271107
2016-07-23 19:34:16abarrysetmessages: + msg271104
2016-07-23 19:19:56SilentGhostsetstatus: closed -> open
resolution: fixed -> (no value)
2016-07-23 19:11:18rhettingersetassignee: docs@python -> mark.dickinson

nosy: + mark.dickinson
2016-07-23 19:03:57magniffsetstatus: open -> closed
2016-07-23 19:03:08magniffsetresolution: fixed
messages: + msg271102
versions: + Python 3.2, Python 3.3, Python 3.4, Python 3.5
2016-07-23 18:50:07abarrysetfiles: + hash_doc_renamed_1.patch
2016-07-23 18:49:52abarrysetfiles: + hash_complex_typo_1.patch

versions: - Python 3.2, Python 3.3, Python 3.4, Python 3.5
keywords: + patch
nosy: + abarry

messages: + msg271100
stage: patch review
2016-07-23 18:25:17magniffsetmessages: + msg271099
2016-07-23 18:17:52magniffcreate