Mercurial > cpython-lru_cache-weakref
annotate Lib/test/test_slice.py @ 27998:e27f58a50737 legacy-trunk
SF bug #690377: Dud footnote reference in distutils docs
| author | Raymond Hettinger <python@rcn.com> |
|---|---|
| date | Fri, 21 Feb 2003 02:47:09 +0000 |
| parents | 6ed2e23aae45 |
| children | 66ba0e0ec202 |
| rev | line source |
|---|---|
|
24319
c43466f7dae8
A few days ago, Guido said (in the thread "[Python-Dev] Python
Michael W. Hudson <mwh@python.net>
parents:
diff
changeset
|
1 # tests for slice objects; in particular the indices method. |
|
c43466f7dae8
A few days ago, Guido said (in the thread "[Python-Dev] Python
Michael W. Hudson <mwh@python.net>
parents:
diff
changeset
|
2 |
|
24364
aa0d2d51fbde
Get rid of relative imports in all unittests. Now anything that
Barry Warsaw <barry@python.org>
parents:
24319
diff
changeset
|
3 from test.test_support import vereq |
|
26035
6ed2e23aae45
Some days, I think my comment of
Michael W. Hudson <mwh@python.net>
parents:
24674
diff
changeset
|
4 import sys |
|
24319
c43466f7dae8
A few days ago, Guido said (in the thread "[Python-Dev] Python
Michael W. Hudson <mwh@python.net>
parents:
diff
changeset
|
5 |
|
c43466f7dae8
A few days ago, Guido said (in the thread "[Python-Dev] Python
Michael W. Hudson <mwh@python.net>
parents:
diff
changeset
|
6 vereq(slice(None ).indices(10), (0, 10, 1)) |
|
c43466f7dae8
A few days ago, Guido said (in the thread "[Python-Dev] Python
Michael W. Hudson <mwh@python.net>
parents:
diff
changeset
|
7 vereq(slice(None, None, 2).indices(10), (0, 10, 2)) |
|
c43466f7dae8
A few days ago, Guido said (in the thread "[Python-Dev] Python
Michael W. Hudson <mwh@python.net>
parents:
diff
changeset
|
8 vereq(slice(1, None, 2).indices(10), (1, 10, 2)) |
|
c43466f7dae8
A few days ago, Guido said (in the thread "[Python-Dev] Python
Michael W. Hudson <mwh@python.net>
parents:
diff
changeset
|
9 vereq(slice(None, None, -1).indices(10), (9, -1, -1)) |
|
c43466f7dae8
A few days ago, Guido said (in the thread "[Python-Dev] Python
Michael W. Hudson <mwh@python.net>
parents:
diff
changeset
|
10 vereq(slice(None, None, -2).indices(10), (9, -1, -2)) |
|
c43466f7dae8
A few days ago, Guido said (in the thread "[Python-Dev] Python
Michael W. Hudson <mwh@python.net>
parents:
diff
changeset
|
11 vereq(slice(3, None, -2).indices(10), (3, -1, -2)) |
|
c43466f7dae8
A few days ago, Guido said (in the thread "[Python-Dev] Python
Michael W. Hudson <mwh@python.net>
parents:
diff
changeset
|
12 vereq(slice(-100, 100 ).indices(10), slice(None).indices(10)) |
|
c43466f7dae8
A few days ago, Guido said (in the thread "[Python-Dev] Python
Michael W. Hudson <mwh@python.net>
parents:
diff
changeset
|
13 vereq(slice(100, -100, -1).indices(10), slice(None, None, -1).indices(10)) |
|
c43466f7dae8
A few days ago, Guido said (in the thread "[Python-Dev] Python
Michael W. Hudson <mwh@python.net>
parents:
diff
changeset
|
14 vereq(slice(-100L, 100L, 2L).indices(10), (0, 10, 2)) |
|
26035
6ed2e23aae45
Some days, I think my comment of
Michael W. Hudson <mwh@python.net>
parents:
24674
diff
changeset
|
15 |
|
6ed2e23aae45
Some days, I think my comment of
Michael W. Hudson <mwh@python.net>
parents:
24674
diff
changeset
|
16 vereq(range(10)[::sys.maxint - 1], [0]) |
