|
From: William S F. <ws...@fu...> - 2007-05-04 09:44:31
|
Eric Mahurin <eric.mahurin <at> gmail.com> writes: > > > On 5/1/07, Nitro <nitro <at> dr-code.org> wrote: > > > Am 02.05.2007, 01:23 Uhr, schrieb Eric Mahurin <eric.mahurin <at> gmail.com>:> I have a series of hacks to the swig 1.3.31 python .i and .swg files that> gives the following STL functionality: > >> * containers (vector, list, deque, set, map, multiset, multimap) of> python> objects that even use custom python compare functions.>> * read/write random-access iterators in those containers. > >> * functors from callable python objects (i.e. lambdas, functions,> methods).> These can operator on normal python objects or those that swig wrapped> (i.e.> C++ objects in a container). > >> * ability to easily wrap most(all?) algorithms to operate on iterators> from> any container (and use the above functors). > > > > Sounds really cool. I guess you are the official swig python stl expertnow This could probably even be ported to be part of the UTL (so thatnobody except you will be able to read the code ;) ).Joking aside, in my opinion these things should go in, probably along with > some examples (if you can be bothered with that) and/or tests anddocumentation. Withouts docs it's one of those features you'll never findout about unless you dig five hours through the swig source and it'll take > you another five hours to understand it.Of course William is the one who decides if this should go in. He'll alsotell you the best way to get it into SVN (probably a patch or the fullfiles or something). > -Matthias > > > I've only been using swig for a little less than a week, so I can't be that much of an expert. I mainly was just writing the C++ code necessary to get these things to work. > I posted what I have here:http://sourceforge.net/tracker/index.php?func=detail&aid=1712193&group_id=1645&atid=301645 > It includes the .swg and .i files necessary, the same description from this post, and a little bit of python testing. The full versions (not patches) of the hacked .swg and .i files are there, so you don't need to put these in the swig install since it searches in the current dir first. Submitting a patch on SF is the best approach to getting it into the distribution. I'm afraid that I'm not familiar enough with the UTL to commit these patches myself, but any of the SWIG developers who is comfortable with this are welcome to commit and test out all the languages that depend on it. With regard to iterators, you might want to take a look at the Ruby improvements in this area that Gonzalo has committed recently. William |