[Python-checkins] cpython (merge 3.5 -> default): Issue #27601: Merge from 3.5
berker.peksag
python-checkins at python.org
Sun Jul 24 21:56:15 EDT 2016
https://hg.python.org/cpython/rev/06bbcbaeeb18
changeset: 102443:06bbcbaeeb18
parent: 102441:f3187a157204
parent: 102442:a6be689eacf8
user: Berker Peksag <berker.peksag at gmail.com>
date: Mon Jul 25 04:56:19 2016 +0300
summary:
Issue #27601: Merge from 3.5
files:
Doc/library/stdtypes.rst | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -692,16 +692,16 @@
m, n = m // P, n // P
if n % P == 0:
- hash_ = sys.hash_info.inf
+ hash_value = sys.hash_info.inf
else:
# Fermat's Little Theorem: pow(n, P-1, P) is 1, so
# pow(n, P-2, P) gives the inverse of n modulo P.
- hash_ = (abs(m) % P) * pow(n, P - 2, P) % P
+ hash_value = (abs(m) % P) * pow(n, P - 2, P) % P
if m < 0:
- hash_ = -hash_
- if hash_ == -1:
- hash_ = -2
- return hash_
+ hash_value = -hash_value
+ if hash_value == -1:
+ hash_value = -2
+ return hash_value
def hash_float(x):
"""Compute the hash of a float x."""
@@ -716,13 +716,13 @@
def hash_complex(z):
"""Compute the hash of a complex number z."""
- hash_ = hash_float(z.real) + sys.hash_info.imag * hash_float(z.imag)
+ hash_value = hash_float(z.real) + sys.hash_info.imag * hash_float(z.imag)
# do a signed reduction modulo 2**sys.hash_info.width
M = 2**(sys.hash_info.width - 1)
- hash_ = (hash_ & (M - 1)) - (hash & M)
- if hash_ == -1:
- hash_ == -2
- return hash_
+ hash_value = (hash_value & (M - 1)) - (hash_value & M)
+ if hash_value == -1:
+ hash_value = -2
+ return hash_value
.. _typeiter:
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list