rustpython 0.1.0

A python interpreter written in rust.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from testutils import assert_raises
import io

print(2 + 3)

assert_raises(TypeError, lambda: print('test', end=4), 'wrong type passed to end')
assert_raises(TypeError, lambda: print('test', sep=['a']), 'wrong type passed to sep')

try:
    print('test', end=None, sep=None, flush=None)
except:
    assert False, 'Expected None passed to end, sep, and flush to not raise errors'

buf = io.StringIO()
print('hello, world', file=buf)
assert buf.getvalue() == 'hello, world\n', buf.getvalue()