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/025973.html below:

[Python-Dev] Xrange and Slices

[Python-Dev] Xrange and SlicesGreg Ewing greg@cosc.canterbury.ac.nz
Thu, 27 Jun 2002 14:38:12 +1200 (NZST)
Oren Tirosh <oren-py-d@hishome.net>:

> Since xrange is the one more commonly used in everyday 
> programming I'd say that slice should be an alias to xrange, not the other
> way around.

I was about to yell "No, don't do that, slice is a type!"
when I decided I'd better make sure that's true...
and found that it's NOT!

Python 2.2 (#14, May 28 2002, 14:11:27) 
[GCC 2.95.2 19991024 (release)] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> slice
<built-in function slice>
>>> s = slice(1,2,3)
>>> s.__class__
<type 'slice'>
>>> 

So... why *isn't* slice == <type 'slice'>?

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg@cosc.canterbury.ac.nz	   +--------------------------------------+




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