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) * |
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) * |
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) * |
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) * |
Date: 2016-07-23 20:24 |
The changes look good to me. Thanks for spotting this!
|
msg271203 - (view) |
Author: Roundup Robot (python-dev) |
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) * |
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) * |
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!
|
|
Date |
User |
Action |
Args |
2022-04-11 14:58:34 | admin | set | github: 71788 |
2016-07-25 02:31:44 | berker.peksag | set | status: open -> closed resolution: fixed messages:
+ msg271212
versions:
- Python 3.2, Python 3.3, Python 3.4 |
2016-07-25 02:22:00 | magniff | set | status: closed -> open resolution: fixed -> (no value) messages:
+ msg271208
versions:
+ Python 3.2, Python 3.3, Python 3.4 |
2016-07-25 01:58:16 | berker.peksag | set | status: 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:17 | python-dev | set | nosy:
+ python-dev messages:
+ msg271203
|
2016-07-23 20:24:11 | mark.dickinson | set | messages:
+ msg271109 |
2016-07-23 20:20:13 | r.david.murray | set | nosy:
+ r.david.murray messages:
+ msg271107
|
2016-07-23 19:34:16 | abarry | set | messages:
+ msg271104 |
2016-07-23 19:19:56 | SilentGhost | set | status: closed -> open resolution: fixed -> (no value) |
2016-07-23 19:11:18 | rhettinger | set | assignee: docs@python -> mark.dickinson
nosy:
+ mark.dickinson |
2016-07-23 19:03:57 | magniff | set | status: open -> closed |
2016-07-23 19:03:08 | magniff | set | resolution: fixed messages:
+ msg271102 versions:
+ Python 3.2, Python 3.3, Python 3.4, Python 3.5 |
2016-07-23 18:50:07 | abarry | set | files:
+ hash_doc_renamed_1.patch |
2016-07-23 18:49:52 | abarry | set | files:
+ 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:17 | magniff | set | messages:
+ msg271099 |
2016-07-23 18:17:52 | magniff | create | |