summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/deque_slice.py
blob: 367aeea3a171c121cb50d6d62530b9c333b54682 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
try:
    from collections import deque
except ImportError:
    print("SKIP")
    raise SystemExit

d = deque((), 10)

d.append(1)
d.append(2)
d.append(3)

# Index slicing for reads is not supported in CPython
try:
    d[0:1]
except TypeError:
    print("TypeError")

# Index slicing for writes is not supported in CPython
try:
    d[0:1] = (-1, -2)
except TypeError:
    print("TypeError")

# Index slicing for writes is not supported in CPython
try:
    del d[0:1]
except TypeError:
    print("TypeError")