2015-08-12 17:07:09 +00:00
|
|
|
# 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
|
|
|
|
|
2017-08-07 14:20:13 +00:00
|
|
|
import sys
|
|
|
|
_PY3 = sys.version_info[0] == 3
|
|
|
|
if _PY3:
|
|
|
|
xrange = range
|
|
|
|
|
2015-08-12 17:07:09 +00:00
|
|
|
import seqs
|
|
|
|
|
|
|
|
### test docs
|
2018-12-13 17:26:03 +00:00
|
|
|
print("doc(seqs): %s" % repr(seqs.__doc__).lstrip('u'))
|
2015-08-12 17:07:09 +00:00
|
|
|
|
2019-03-06 10:41:03 +00:00
|
|
|
# note: arrays not settable from python -- use slices instead
|
2015-08-12 17:07:09 +00:00
|
|
|
|
2019-03-06 10:41:03 +00:00
|
|
|
# print("arr = seqs.Array(xrange(2))")
|
|
|
|
# arr = seqs.Array(xrange(2))
|
|
|
|
# print("arr = %s" % (arr,))
|
|
|
|
#
|
2015-08-12 17:07:09 +00:00
|
|
|
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,))
|
|
|
|
|
2019-01-16 13:47:57 +00:00
|
|
|
print("OK")
|