Mercurial > pylearn
annotate lookup_list.py @ 437:2d8490d76b3e
added two methods to make_test_datasets
author | Olivier Breuleux <breuleuo@iro.umontreal.ca> |
---|---|
date | Wed, 06 Aug 2008 19:39:36 -0400 |
parents | 52b4908d8971 |
children |
rev | line source |
---|---|
22
b6b36f65664f
Created virtual sub-classes of DataSet: {Finite{Length,Width},Sliceable}DataSet,
bengioy@esprit.iro.umontreal.ca
parents:
20
diff
changeset
|
1 |
79
427e02ef0629
-bugfix. We need to make deep copy otherwise we modify this instance event if we should not do it.
Frederic Bastien <bastienf@iro.umontreal.ca>
parents:
45
diff
changeset
|
2 from copy import deepcopy |
12
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
3 |
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
4 class LookupList(object): |
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
5 """ |
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
6 A LookupList is a sequence whose elements can be named (and unlike |
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
7 a dictionary the order of the elements depends not on their key but |
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
8 on the order given by the user through construction) so that |
167 | 9 following syntactic constructions work as one would expect:: |
300
7c5e5356cb11
doctest syntax for lookup_list
James Bergstra <bergstrj@iro.umontreal.ca>
parents:
193
diff
changeset
|
10 >>> example = LookupList(['x','y','z'],[1,2,3]) |
7c5e5356cb11
doctest syntax for lookup_list
James Bergstra <bergstrj@iro.umontreal.ca>
parents:
193
diff
changeset
|
11 >>> example['x'] = [1, 2, 3] # set or change a field |
7c5e5356cb11
doctest syntax for lookup_list
James Bergstra <bergstrj@iro.umontreal.ca>
parents:
193
diff
changeset
|
12 >>> print example('z','y') # prints [3,2] |
7c5e5356cb11
doctest syntax for lookup_list
James Bergstra <bergstrj@iro.umontreal.ca>
parents:
193
diff
changeset
|
13 >>> x, y, z = example |
7c5e5356cb11
doctest syntax for lookup_list
James Bergstra <bergstrj@iro.umontreal.ca>
parents:
193
diff
changeset
|
14 >>> x = example[0] |
7c5e5356cb11
doctest syntax for lookup_list
James Bergstra <bergstrj@iro.umontreal.ca>
parents:
193
diff
changeset
|
15 >>> x = example["x"] |
7c5e5356cb11
doctest syntax for lookup_list
James Bergstra <bergstrj@iro.umontreal.ca>
parents:
193
diff
changeset
|
16 >>> print example.keys() # prints ['x','y','z'] |
7c5e5356cb11
doctest syntax for lookup_list
James Bergstra <bergstrj@iro.umontreal.ca>
parents:
193
diff
changeset
|
17 >>> print example.values() # prints [[1,2,3],2,3] |
7c5e5356cb11
doctest syntax for lookup_list
James Bergstra <bergstrj@iro.umontreal.ca>
parents:
193
diff
changeset
|
18 >>> print example.items() # prints [('x',[1,2,3]),('y',2),('z',3)] |
7c5e5356cb11
doctest syntax for lookup_list
James Bergstra <bergstrj@iro.umontreal.ca>
parents:
193
diff
changeset
|
19 >>> example.append_keyval('u',0) # adds item with name 'u' and value 0 |
7c5e5356cb11
doctest syntax for lookup_list
James Bergstra <bergstrj@iro.umontreal.ca>
parents:
193
diff
changeset
|
20 >>> print len(example) # number of items = 4 here |
7c5e5356cb11
doctest syntax for lookup_list
James Bergstra <bergstrj@iro.umontreal.ca>
parents:
193
diff
changeset
|
21 >>> example2 = LookupList(['v', 'w'], ['a','b']) |
7c5e5356cb11
doctest syntax for lookup_list
James Bergstra <bergstrj@iro.umontreal.ca>
parents:
193
diff
changeset
|
22 >>> print example+example2 # addition is like for lists, a concatenation of the items. |
7c5e5356cb11
doctest syntax for lookup_list
James Bergstra <bergstrj@iro.umontreal.ca>
parents:
193
diff
changeset
|
23 >>> example + example # throw an error as we can't have duplicate name. |
7c5e5356cb11
doctest syntax for lookup_list
James Bergstra <bergstrj@iro.umontreal.ca>
parents:
193
diff
changeset
|
24 |
167 | 25 @note: The element names should be unique. |
300
7c5e5356cb11
doctest syntax for lookup_list
James Bergstra <bergstrj@iro.umontreal.ca>
parents:
193
diff
changeset
|
26 |
167 | 27 @todo: Convert this documentation into doctest |
28 format, and actually perform doctest'ing: | |
29 U{http://epydoc.sourceforge.net/manual-epytext.html#doctest-blocks} | |
12
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
30 """ |
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
31 def __init__(self,names=[],values=[]): |
428
52b4908d8971
simple example of theano
Thierry Bertin-Mahieux <bertinmt@iro.umontreal.ca>
parents:
423
diff
changeset
|
32 #print 'values=', values |
52b4908d8971
simple example of theano
Thierry Bertin-Mahieux <bertinmt@iro.umontreal.ca>
parents:
423
diff
changeset
|
33 #print 'length=', len(values) |
52b4908d8971
simple example of theano
Thierry Bertin-Mahieux <bertinmt@iro.umontreal.ca>
parents:
423
diff
changeset
|
34 #print 'names=', names |
52b4908d8971
simple example of theano
Thierry Bertin-Mahieux <bertinmt@iro.umontreal.ca>
parents:
423
diff
changeset
|
35 #print 'length=',len(names) |
12
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
36 assert len(values)==len(names) |
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
37 self.__dict__['_values']=values |
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
38 self.__dict__['_name2index']={} |
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
39 self.__dict__['_names']=names |
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
40 for i in xrange(len(values)): |
22
b6b36f65664f
Created virtual sub-classes of DataSet: {Finite{Length,Width},Sliceable}DataSet,
bengioy@esprit.iro.umontreal.ca
parents:
20
diff
changeset
|
41 assert names[i] not in self._name2index |
12
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
42 self._name2index[names[i]]=i |
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
43 |
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
44 def keys(self): |
17
759d17112b23
more comments, looping ArrayDataSet iterator, bugfixes to lookup_list, more tests
bergstrj@iro.umontreal.ca
parents:
12
diff
changeset
|
45 return self._names |
12
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
46 |
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
47 def values(self): |
17
759d17112b23
more comments, looping ArrayDataSet iterator, bugfixes to lookup_list, more tests
bergstrj@iro.umontreal.ca
parents:
12
diff
changeset
|
48 return self._values |
12
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
49 |
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
50 def items(self): |
22
b6b36f65664f
Created virtual sub-classes of DataSet: {Finite{Length,Width},Sliceable}DataSet,
bengioy@esprit.iro.umontreal.ca
parents:
20
diff
changeset
|
51 """ |
b6b36f65664f
Created virtual sub-classes of DataSet: {Finite{Length,Width},Sliceable}DataSet,
bengioy@esprit.iro.umontreal.ca
parents:
20
diff
changeset
|
52 Return a list of (name,value) pairs of all the items in the look-up list. |
b6b36f65664f
Created virtual sub-classes of DataSet: {Finite{Length,Width},Sliceable}DataSet,
bengioy@esprit.iro.umontreal.ca
parents:
20
diff
changeset
|
53 """ |
12
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
54 return zip(self._names,self._values) |
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
55 |
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
56 def __getitem__(self,key): |
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
57 """ |
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
58 The key in example[key] can either be an integer to index the fields |
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
59 or the name of the field. |
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
60 """ |
134
3f4e5c9bdc5e
Fixes to ApplyFunctionDataSet and other things to make learner and mlp work
Yoshua Bengio <bengioy@iro.umontreal.ca>
parents:
133
diff
changeset
|
61 if isinstance(key,int) or isinstance(key,slice) or (isinstance(key,list) and all([isinstance(i,int) for i in key])): |
12
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
62 return self._values[key] |
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
63 else: # if not an int, key must be a name |
45
a5c70dc42972
Test functions for dataset.py
bengioy@grenat.iro.umontreal.ca
parents:
22
diff
changeset
|
64 # expecting key to be a valid field name |
a5c70dc42972
Test functions for dataset.py
bengioy@grenat.iro.umontreal.ca
parents:
22
diff
changeset
|
65 assert isinstance(key,str) |
12
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
66 return self._values[self._name2index[key]] |
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
67 |
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
68 def __setitem__(self,key,value): |
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
69 if isinstance(key,int): |
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
70 self._values[key]=value |
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
71 else: # if not an int, key must be a name |
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
72 if key in self._name2index: |
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
73 self._values[self._name2index[key]]=value |
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
74 else: |
22
b6b36f65664f
Created virtual sub-classes of DataSet: {Finite{Length,Width},Sliceable}DataSet,
bengioy@esprit.iro.umontreal.ca
parents:
20
diff
changeset
|
75 self.append_keyval(key,value) |
b6b36f65664f
Created virtual sub-classes of DataSet: {Finite{Length,Width},Sliceable}DataSet,
bengioy@esprit.iro.umontreal.ca
parents:
20
diff
changeset
|
76 |
19 | 77 def append_keyval(self, key, value): |
22
b6b36f65664f
Created virtual sub-classes of DataSet: {Finite{Length,Width},Sliceable}DataSet,
bengioy@esprit.iro.umontreal.ca
parents:
20
diff
changeset
|
78 assert key not in self._name2index |
19 | 79 self._name2index[key]=len(self) |
80 self._values.append(value) | |
81 self._names.append(key) | |
12
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
82 |
137
ff6b7bfb6cdc
added function LookupList.append_lookuplist
Frederic Bastien <bastienf@iro.umontreal.ca>
parents:
110
diff
changeset
|
83 def append_lookuplist(self, *list): |
ff6b7bfb6cdc
added function LookupList.append_lookuplist
Frederic Bastien <bastienf@iro.umontreal.ca>
parents:
110
diff
changeset
|
84 for l in list: |
ff6b7bfb6cdc
added function LookupList.append_lookuplist
Frederic Bastien <bastienf@iro.umontreal.ca>
parents:
110
diff
changeset
|
85 for key in l.keys(): |
ff6b7bfb6cdc
added function LookupList.append_lookuplist
Frederic Bastien <bastienf@iro.umontreal.ca>
parents:
110
diff
changeset
|
86 self.append_keyval(key,l[key]) |
ff6b7bfb6cdc
added function LookupList.append_lookuplist
Frederic Bastien <bastienf@iro.umontreal.ca>
parents:
110
diff
changeset
|
87 del l |
ff6b7bfb6cdc
added function LookupList.append_lookuplist
Frederic Bastien <bastienf@iro.umontreal.ca>
parents:
110
diff
changeset
|
88 |
12
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
89 def __len__(self): |
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
90 return len(self._values) |
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
91 |
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
92 def __repr__(self): |
ff4e551490f1
Added LookupList type in lookup_list.py and used it to keep order
bengioy@esprit.iro.umontreal.ca
parents:
diff
changeset
|
93 return "{%s}" % ", ".join([str(k) + "=" + repr(v) for k,v in self.items()]) |
22
b6b36f65664f
Created virtual sub-classes of DataSet: {Finite{Length,Width},Sliceable}DataSet,
bengioy@esprit.iro.umontreal.ca
parents:
20
diff
changeset
|
94 |
b6b36f65664f
Created virtual sub-classes of DataSet: {Finite{Length,Width},Sliceable}DataSet,
bengioy@esprit.iro.umontreal.ca
parents:
20
diff
changeset
|
95 def __add__(self,rhs): |
79
427e02ef0629
-bugfix. We need to make deep copy otherwise we modify this instance event if we should not do it.
Frederic Bastien <bastienf@iro.umontreal.ca>
parents:
45
diff
changeset
|
96 new_example = deepcopy(self) |
22
b6b36f65664f
Created virtual sub-classes of DataSet: {Finite{Length,Width},Sliceable}DataSet,
bengioy@esprit.iro.umontreal.ca
parents:
20
diff
changeset
|
97 for item in rhs.items(): |
b6b36f65664f
Created virtual sub-classes of DataSet: {Finite{Length,Width},Sliceable}DataSet,
bengioy@esprit.iro.umontreal.ca
parents:
20
diff
changeset
|
98 new_example.append_keyval(item[0],item[1]) |
b6b36f65664f
Created virtual sub-classes of DataSet: {Finite{Length,Width},Sliceable}DataSet,
bengioy@esprit.iro.umontreal.ca
parents:
20
diff
changeset
|
99 return new_example |
b6b36f65664f
Created virtual sub-classes of DataSet: {Finite{Length,Width},Sliceable}DataSet,
bengioy@esprit.iro.umontreal.ca
parents:
20
diff
changeset
|
100 |
b6b36f65664f
Created virtual sub-classes of DataSet: {Finite{Length,Width},Sliceable}DataSet,
bengioy@esprit.iro.umontreal.ca
parents:
20
diff
changeset
|
101 def __radd__(self,lhs): |
79
427e02ef0629
-bugfix. We need to make deep copy otherwise we modify this instance event if we should not do it.
Frederic Bastien <bastienf@iro.umontreal.ca>
parents:
45
diff
changeset
|
102 new_example = deepcopy(lhs) |
22
b6b36f65664f
Created virtual sub-classes of DataSet: {Finite{Length,Width},Sliceable}DataSet,
bengioy@esprit.iro.umontreal.ca
parents:
20
diff
changeset
|
103 for item in self.items(): |
b6b36f65664f
Created virtual sub-classes of DataSet: {Finite{Length,Width},Sliceable}DataSet,
bengioy@esprit.iro.umontreal.ca
parents:
20
diff
changeset
|
104 new_example.append_keyval(item[0],item[1]) |
b6b36f65664f
Created virtual sub-classes of DataSet: {Finite{Length,Width},Sliceable}DataSet,
bengioy@esprit.iro.umontreal.ca
parents:
20
diff
changeset
|
105 return new_example |
b6b36f65664f
Created virtual sub-classes of DataSet: {Finite{Length,Width},Sliceable}DataSet,
bengioy@esprit.iro.umontreal.ca
parents:
20
diff
changeset
|
106 |
79
427e02ef0629
-bugfix. We need to make deep copy otherwise we modify this instance event if we should not do it.
Frederic Bastien <bastienf@iro.umontreal.ca>
parents:
45
diff
changeset
|
107 def __eq__(self, other): |
427e02ef0629
-bugfix. We need to make deep copy otherwise we modify this instance event if we should not do it.
Frederic Bastien <bastienf@iro.umontreal.ca>
parents:
45
diff
changeset
|
108 return self._values==other._values and self._name2index==other._name2index and self._names==other._names |
427e02ef0629
-bugfix. We need to make deep copy otherwise we modify this instance event if we should not do it.
Frederic Bastien <bastienf@iro.umontreal.ca>
parents:
45
diff
changeset
|
109 |
427e02ef0629
-bugfix. We need to make deep copy otherwise we modify this instance event if we should not do it.
Frederic Bastien <bastienf@iro.umontreal.ca>
parents:
45
diff
changeset
|
110 def __ne__(self, other): |
427e02ef0629
-bugfix. We need to make deep copy otherwise we modify this instance event if we should not do it.
Frederic Bastien <bastienf@iro.umontreal.ca>
parents:
45
diff
changeset
|
111 return not self.__eq__(other) |
427e02ef0629
-bugfix. We need to make deep copy otherwise we modify this instance event if we should not do it.
Frederic Bastien <bastienf@iro.umontreal.ca>
parents:
45
diff
changeset
|
112 |
133 | 113 def __hash__(self): |
79
427e02ef0629
-bugfix. We need to make deep copy otherwise we modify this instance event if we should not do it.
Frederic Bastien <bastienf@iro.umontreal.ca>
parents:
45
diff
changeset
|
114 raise NotImplementedError() |
110
8fa1ef2411a0
Worked on OneShotTLearner and implementation of LinearRegression
bengioy@bengiomac.local
parents:
79
diff
changeset
|
115 |
133 | 116 def __call__(self,*names): |
110
8fa1ef2411a0
Worked on OneShotTLearner and implementation of LinearRegression
bengioy@bengiomac.local
parents:
79
diff
changeset
|
117 """ |
8fa1ef2411a0
Worked on OneShotTLearner and implementation of LinearRegression
bengioy@bengiomac.local
parents:
79
diff
changeset
|
118 Return a list of values associated with the given names (which must all be keys of the lookup list). |
8fa1ef2411a0
Worked on OneShotTLearner and implementation of LinearRegression
bengioy@bengiomac.local
parents:
79
diff
changeset
|
119 """ |
193
cb6b945acf5a
Complete redesign of learner...
Yoshua Bengio <bengioy@iro.umontreal.ca>
parents:
167
diff
changeset
|
120 if names == self._names: |
cb6b945acf5a
Complete redesign of learner...
Yoshua Bengio <bengioy@iro.umontreal.ca>
parents:
167
diff
changeset
|
121 return self._values |
110
8fa1ef2411a0
Worked on OneShotTLearner and implementation of LinearRegression
bengioy@bengiomac.local
parents:
79
diff
changeset
|
122 return [self[name] for name in names] |
137
ff6b7bfb6cdc
added function LookupList.append_lookuplist
Frederic Bastien <bastienf@iro.umontreal.ca>
parents:
110
diff
changeset
|
123 |
ff6b7bfb6cdc
added function LookupList.append_lookuplist
Frederic Bastien <bastienf@iro.umontreal.ca>
parents:
110
diff
changeset
|
124 |
ff6b7bfb6cdc
added function LookupList.append_lookuplist
Frederic Bastien <bastienf@iro.umontreal.ca>
parents:
110
diff
changeset
|
125 if __name__ == '__main__': |
ff6b7bfb6cdc
added function LookupList.append_lookuplist
Frederic Bastien <bastienf@iro.umontreal.ca>
parents:
110
diff
changeset
|
126 |
ff6b7bfb6cdc
added function LookupList.append_lookuplist
Frederic Bastien <bastienf@iro.umontreal.ca>
parents:
110
diff
changeset
|
127 a=LookupList(['a'],[1]) |
ff6b7bfb6cdc
added function LookupList.append_lookuplist
Frederic Bastien <bastienf@iro.umontreal.ca>
parents:
110
diff
changeset
|
128 print a |
ff6b7bfb6cdc
added function LookupList.append_lookuplist
Frederic Bastien <bastienf@iro.umontreal.ca>
parents:
110
diff
changeset
|
129 b=LookupList(['b'],[2]) |
ff6b7bfb6cdc
added function LookupList.append_lookuplist
Frederic Bastien <bastienf@iro.umontreal.ca>
parents:
110
diff
changeset
|
130 print b |
ff6b7bfb6cdc
added function LookupList.append_lookuplist
Frederic Bastien <bastienf@iro.umontreal.ca>
parents:
110
diff
changeset
|
131 a.append_lookuplist(b) |
ff6b7bfb6cdc
added function LookupList.append_lookuplist
Frederic Bastien <bastienf@iro.umontreal.ca>
parents:
110
diff
changeset
|
132 print a |
ff6b7bfb6cdc
added function LookupList.append_lookuplist
Frederic Bastien <bastienf@iro.umontreal.ca>
parents:
110
diff
changeset
|
133 a.append_lookuplist(b) |
ff6b7bfb6cdc
added function LookupList.append_lookuplist
Frederic Bastien <bastienf@iro.umontreal.ca>
parents:
110
diff
changeset
|
134 print a |