gopy/_examples/seqs/test.py

44 lines
880 B
Python
Raw Normal View History

# Copyright 2015 The go-python Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
## py2/py3 compat
from __future__ import print_function
import seqs
### test docs
print("doc(seqs): %r" % (seqs.__doc__,))
print("arr = seqs.Array(xrange(2))")
arr = seqs.Array(xrange(2))
print("arr = %s" % (arr,))
print("s = seqs.Slice()")
s = seqs.Slice()
print("s = %s" % (s,))
print("s = seqs.Slice([1,2])")
s = seqs.Slice([1,2])
print("s = %s" % (s,))
print("s = seqs.Slice(range(10))")
s = seqs.Slice(range(10))
print("s = %s" % (s,))
print("s = seqs.Slice(xrange(10))")
s = seqs.Slice(xrange(10))
print("s = %s" % (s,))
print("s = seqs.Slice()")
s = seqs.Slice()
print("s = %s" % (s,))
print("s += [1,2]")
s += [1,2]
print("s = %s" % (s,))
print("s += [10,20]")
s += [10,20]
print("s = %s" % (s,))