Mercurial > pylearn
diff lookup_list.py @ 167:4803cb76e26b
Updated documentation
author | Joseph Turian <turian@gmail.com> |
---|---|
date | Mon, 12 May 2008 18:51:42 -0400 |
parents | ad144fa72bf5 |
children | cb6b945acf5a |
line wrap: on
line diff
--- a/lookup_list.py Mon May 12 18:40:17 2008 -0400 +++ b/lookup_list.py Mon May 12 18:51:42 2008 -0400 @@ -6,7 +6,7 @@ A LookupList is a sequence whose elements can be named (and unlike a dictionary the order of the elements depends not on their key but on the order given by the user through construction) so that - following syntactic constructions work as one would expect: + following syntactic constructions work as one would expect:: example = LookupList(['x','y','z'],[1,2,3]) example['x'] = [1, 2, 3] # set or change a field print example('z','y') # prints [3,2] @@ -21,7 +21,10 @@ example2 = LookupList(['v', 'w'], ['a','b']) print example+example2 # addition is like for lists, a concatenation of the items. example + example # throw an error as we can't have duplicate name. - Note that the element names should be unique. + @note: The element names should be unique. + @todo: Convert this documentation into doctest + format, and actually perform doctest'ing: + U{http://epydoc.sourceforge.net/manual-epytext.html#doctest-blocks} """ def __init__(self,names=[],values=[]): assert len(values)==len(names)