From: Marcelo M. <mar...@us...> - 2006-02-20 07:33:21
|
Update of /cvsroot/swig/SWIG/Lib/python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9690/Lib/python Modified Files: pycontainer.swg pyiterators.swg std_map.i std_pair.i Log Message: cosmetic for generated python code Index: pyiterators.swg =================================================================== RCS file: /cvsroot/swig/SWIG/Lib/python/pyiterators.swg,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** pyiterators.swg 6 Feb 2006 03:58:58 -0000 1.12 --- pyiterators.swg 20 Feb 2006 07:33:18 -0000 1.13 *************** *** 317,324 **** %nodirector PySwigIterator; %extend PySwigIterator { ! %pythoncode { ! def __iter__(self): ! return self ! } } --- 317,321 ---- %nodirector PySwigIterator; %extend PySwigIterator { ! %pythoncode {def __iter__(self): return self} } Index: pycontainer.swg =================================================================== RCS file: /cvsroot/swig/SWIG/Lib/python/pycontainer.swg,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** pycontainer.swg 18 Feb 2006 08:17:22 -0000 1.42 --- pycontainer.swg 20 Feb 2006 07:33:18 -0000 1.43 *************** *** 575,582 **** } ! %pythoncode { ! def __iter__(self): ! return self.iterator() ! } } #endif //SWIG_EXPORT_ITERATOR_METHODS --- 575,579 ---- } ! %pythoncode {def __iter__(self): return self.iterator()} } #endif //SWIG_EXPORT_ITERATOR_METHODS Index: std_map.i =================================================================== RCS file: /cvsroot/swig/SWIG/Lib/python/std_map.i,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** std_map.i 9 Jan 2006 00:40:44 -0000 1.22 --- std_map.i 20 Feb 2006 07:33:18 -0000 1.23 *************** *** 232,248 **** } ! %pythoncode { ! def __iter__(self): ! return self.key_iterator() ! ! def iterkeys(self): ! return self.key_iterator() ! ! def itervalues(self): ! return self.value_iterator() ! ! def iteritems(self): ! return self.iterator() ! } } %enddef --- 232,239 ---- } ! %pythoncode {def __iter__(self): return self.key_iterator()} ! %pythoncode {def iterkeys(self): return self.key_iterator()} ! %pythoncode {def itervalues(self): return self.value_iterator()} ! %pythoncode {def iteritems(self): return self.iterator()} } %enddef Index: std_pair.i =================================================================== RCS file: /cvsroot/swig/SWIG/Lib/python/std_pair.i,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** std_pair.i 27 Dec 2005 22:06:25 -0000 1.23 --- std_pair.i 20 Feb 2006 07:33:18 -0000 1.24 *************** *** 121,128 **** %define %swig_pair_methods(pair...) %extend { ! %pythoncode { ! def __len__(self): ! return 2 ! def __getitem__(self, index): if not (index % 2): return self.first --- 121,127 ---- %define %swig_pair_methods(pair...) %extend { ! %pythoncode {def __len__(self): return 2 ! def __repr__(self): return str((self.first, self.second)) ! def __getitem__(self, index): if not (index % 2): return self.first *************** *** 133,144 **** self.first = val else: ! self.second = val ! def __repr__(self): ! return str((self.first, self.second)) ! } } %enddef - %include <std/std_pair.i> --- 132,139 ---- self.first = val else: ! self.second = val} } %enddef %include <std/std_pair.i> |