A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-checkins/2002-July/028056.html below:

[Python-checkins] python/dist/src/Lib/test test_slice.py,NONE,1.1

[Python-checkins] python/dist/src/Lib/test test_slice.py,NONE,1.1mwh@users.sourceforge.net mwh@users.sourceforge.net
Fri, 19 Jul 2002 08:47:09 -0700
Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv31521/Lib/test

Added Files:
	test_slice.py 
Log Message:
A few days ago, Guido said (in the thread "[Python-Dev] Python 
version of PySlice_GetIndicesEx"):

> OK.  Michael, if you want to check in indices(), go ahead.

Then I did what was needed, but didn't check it in.  Here it is.


--- NEW FILE: test_slice.py ---
# tests for slice objects; in particular the indices method.

from test_support import vereq

vereq(slice(None           ).indices(10), (0, 10,  1))
vereq(slice(None,  None,  2).indices(10), (0, 10,  2))
vereq(slice(1,     None,  2).indices(10), (1, 10,  2))
vereq(slice(None,  None, -1).indices(10), (9, -1, -1))
vereq(slice(None,  None, -2).indices(10), (9, -1, -2))
vereq(slice(3,     None, -2).indices(10), (3, -1, -2))
vereq(slice(-100,  100     ).indices(10), slice(None).indices(10))
vereq(slice(100,  -100,  -1).indices(10), slice(None, None, -1).indices(10))
vereq(slice(-100L, 100L, 2L).indices(10), (0, 10,  2))







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