File: pair.py

package info (click to toggle)
metakit 2.4.3-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 6,468 kB
  • ctags: 3,548
  • sloc: xml: 29,455; cpp: 23,339; sh: 9,051; tcl: 1,195; python: 577; makefile: 254; ansic: 14
file content (26 lines) | stat: -rw-r--r-- 388 bytes parent folder | download | duplicates (2)
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
# Small demo of v1.pair(v2)
#
# Expected output:
#  s    i
#  -----  -
#  zero 0
#  one  1
#  two  2
#  three  3
#  four 4
#  five 5
#  -----  -
#  Total: 6 rows

import metakit

db = metakit.storage()
v1 = db.getas("one[s:S]")
v2 = db.getas("two[i:I]")

for v in ['zero','one','two','three','four','five']:
  v1.append(s=v)
for v in range(6):
  v2.append(i=v)

metakit.dump(v1.pair(v2))