summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/builtin_pow3.py
blob: dec7253bbd4958fa7398e4c835a046c25b3acd6b (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
# test builtin pow() with integral values
# 3 arg version

try:
    print(pow(3, 4, 7))
except NotImplementedError:
    import sys
    print("SKIP")
    sys.exit()

# 3 arg pow is defined to only work on integers
try:
    print(pow("x", 5, 6))
except TypeError:
    print("TypeError expected")

try:
    print(pow(4, "y", 6))
except TypeError:
    print("TypeError expected")

try:
    print(pow(4, 5, "z"))
except TypeError:
    print("TypeError expected")