Functions
srt_ntide_list_set_t Namespace Reference

Functions

def dump_list_set (obj)
 
def dump_list (lst)
 
def test1 ()
 

Function Documentation

def srt_ntide_list_set_t.dump_list (   lst)

Definition at line 14 of file srt_ntide_list_set_t.py.

14 def dump_list (lst):
15  for item in lst:
16  print item,
17 
def srt_ntide_list_set_t.dump_list_set (   obj)

Definition at line 9 of file srt_ntide_list_set_t.py.

9 def dump_list_set (obj):
10  lst = obj.get_list()
11  for item in lst:
12  print item,
13 
def srt_ntide_list_set_t.test1 ( )

Definition at line 18 of file srt_ntide_list_set_t.py.

18 def test1():
19  l1 = ["opt1", "opt2", "opt3"]
20  l2 = ["opt1", "opt2", "opt3"]
21 
23  obj.intersection (l1)
24  obj.intersection (l2)
25 
26  print "options 1, 2, and 3:",
27  dump_list_set (obj)
28  print
29 
30  l3 = ["opt1", "opt2", "opt3", "opt4"]
31  print "Difference with 4 items should give one:",
32  dump_list (obj.difference(l3))
33  print
34 
35  print "Difference with l1 should give nothing:",
36  dump_list (obj.difference(l2))
37  print
38 
39  print "2 item list (1 common), contents now:",
40  l4 = ["opt1", "opt5"]
41  obj.intersection (l4)
42  dump_list_set (obj)
43  print
44 
45  print "diff with 2, one diff (at start):",
46  l5 = ["opt6", "opt1"]
47  dump_list (obj.difference(l5))
48  print
49 
50  print "Adding list with opt6 and opt1:",
51  obj.add(l5)
52  dump_list_set (obj)
53 
54 test1()