Issue #1766304: Optimize membership testing for ranges: 'n in range(...)'
does an O(1) check, if n is an integer. Non-integers aren't affected.
Thanks Robert Lehmann.
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index 198ff7b..ef021dd 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -925,6 +925,10 @@
>>> list(range(1, 0))
[]
+ .. versionchanged:: 3.2
+ Testing integers for membership takes constant time instead of
+ iterating through all items.
+
.. function:: repr(object)