A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-June/025943.html below:

[Python-Dev] Xrange and Slices

[Python-Dev] Xrange and SlicesRaymond Hettinger python@rcn.com
Wed, 26 Jun 2002 02:37:17 -0400
Wild idea of the day:
Merge the code for xrange() into slice().
So that old code will work, make the word 'xrange' a synonym for 'slice'

>>> x = xrange(0,10,2)
>>> s = slice(0,10,2)
>>> [m for m in dir(x) if m not in dir(s)]
['__getitem__', '__iter__', '__len__']  
>>> [m for m in dir(s) if m not in dir(x)]
['__cmp__', 'start', 'step', 'stop']


Raymond Hettinger
'regnitteh dnomyar'[::-1]






RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4