[issue28614] Slice limit documentation is incorrect

airwin report at bugs.python.org
Fri Nov 4 16:13:31 EDT 2016


airwin added the comment:

You can easily prove the limit is correct for real numbers.  So I would be willing to accept as a resolution of this issue that the type of division that is going on here is real.  However, that is a bit disquieting since if you try a real slice index you get "TypeError: slice indices must be integers or None or have an __index__ method". Thus, m < real limit test is a comparison of an integer and real which implies m gets changed to real before the comparison. Which obviously gives the correct result in the 1.5 case, but in general I dislike real comparisons where the distinction between < and <=, for example, can get blurred because of potential roundoff issues with reals.  So I think my suggested one-sentence resolution to the issue is better then updating the documentation to clarify what kind of division is occurring in the limit.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28614>
_______________________________________


More information about the Python-bugs-list mailing list