Mercurial > cpython-lru_cache-weakref
annotate Lib/test/test_structseq.py @ 21283:d4907cdcc299 legacy-trunk
Use an immutable tuple for __slots instead of a mutable list
Bump version number
| author | Andrew M. Kuchling <amk@amk.ca> |
|---|---|
| date | Fri, 07 Dec 2001 14:22:13 +0000 |
| parents | 61226ddadc97 |
| children | 42862169541f |
| rev | line source |
|---|---|
|
20780
ab2e315849a7
Fix bad bug in structseq slicing (NULL pointers in result). Reported by
Tim Peters <tim.peters@gmail.com>
parents:
diff
changeset
|
1 from test_support import vereq |
|
ab2e315849a7
Fix bad bug in structseq slicing (NULL pointers in result). Reported by
Tim Peters <tim.peters@gmail.com>
parents:
diff
changeset
|
2 |
|
ab2e315849a7
Fix bad bug in structseq slicing (NULL pointers in result). Reported by
Tim Peters <tim.peters@gmail.com>
parents:
diff
changeset
|
3 import time |
|
ab2e315849a7
Fix bad bug in structseq slicing (NULL pointers in result). Reported by
Tim Peters <tim.peters@gmail.com>
parents:
diff
changeset
|
4 |
|
ab2e315849a7
Fix bad bug in structseq slicing (NULL pointers in result). Reported by
Tim Peters <tim.peters@gmail.com>
parents:
diff
changeset
|
5 t = time.gmtime() |
|
ab2e315849a7
Fix bad bug in structseq slicing (NULL pointers in result). Reported by
Tim Peters <tim.peters@gmail.com>
parents:
diff
changeset
|
6 astuple = tuple(t) |
|
ab2e315849a7
Fix bad bug in structseq slicing (NULL pointers in result). Reported by
Tim Peters <tim.peters@gmail.com>
parents:
diff
changeset
|
7 vereq(len(t), len(astuple)) |
|
ab2e315849a7
Fix bad bug in structseq slicing (NULL pointers in result). Reported by
Tim Peters <tim.peters@gmail.com>
parents:
diff
changeset
|
8 vereq(t, astuple) |
|
ab2e315849a7
Fix bad bug in structseq slicing (NULL pointers in result). Reported by
Tim Peters <tim.peters@gmail.com>
parents:
diff
changeset
|
9 |
|
ab2e315849a7
Fix bad bug in structseq slicing (NULL pointers in result). Reported by
Tim Peters <tim.peters@gmail.com>
parents:
diff
changeset
|
10 # Check that slicing works the same way; at one point, slicing t[i:j] with |
|
ab2e315849a7
Fix bad bug in structseq slicing (NULL pointers in result). Reported by
Tim Peters <tim.peters@gmail.com>
parents:
diff
changeset
|
11 # 0 < i < j could produce NULLs in the result. |
|
ab2e315849a7
Fix bad bug in structseq slicing (NULL pointers in result). Reported by
Tim Peters <tim.peters@gmail.com>
parents:
diff
changeset
|
12 for i in range(-len(t), len(t)): |
|
ab2e315849a7
Fix bad bug in structseq slicing (NULL pointers in result). Reported by
Tim Peters <tim.peters@gmail.com>
parents:
diff
changeset
|
13 for j in range(-len(t), len(t)): |
|
ab2e315849a7
Fix bad bug in structseq slicing (NULL pointers in result). Reported by
Tim Peters <tim.peters@gmail.com>
parents:
diff
changeset
|
14 vereq(t[i:j], astuple[i:j]) |
|
ab2e315849a7
Fix bad bug in structseq slicing (NULL pointers in result). Reported by
Tim Peters <tim.peters@gmail.com>
parents:
diff
changeset
|
15 |
|
20781
61226ddadc97
Huh. In an effort to be less thorough <wink>, seems I checked in a new
Tim Peters <tim.peters@gmail.com>
parents:
20780
diff
changeset
|
16 # XXX more needed |
