Hi,
2010/5/6 ffao <
fet...@gmail.com>:
> Well, somebody had to do this, so I gave it a try.
> Here is a (tentative) dict implementation, I haven't tested it
> extensively yet:
http://stuffr.net/d/06il36z
Thanks ffao!
> There are some warnings about NULL arithmetic and lines 2217 and 2218
> of builtin.cpp give errors (I probably deleted the declaration for
> __none somewhere, I'm not sure). It does pass some preliminary tests
> if you comment out those lines, if that counts for something (not the
> shedskin unit tests however, as I couldn't figure out which ones deal
> with dicts and which ones don't).
You just deleted the following lines:
template<class T> T __none() { return NULL; }
template<> int __none();
template<> double __none();
After re-adding them, it works fine in my tests :-)
Side note: there is something funny (or not) with shedskin's dict :
the storage (or display) order is not the same as with CPython.
For example:
foo = {
'bar': 'lol',
'xd' : 'pdtr',
'tt': 'vg',
'56': '33',
}
CPython: {'tt': 'vg', '56': '33', 'bar': 'lol', 'xd': 'pdtr'}
ShedSkin (old): {'bar': 'lol', 'tt': 'vg', '56': '33', 'xd': 'pdtr'}
ShedSkin (new): {'xd': 'pdtr', 'bar': 'lol', '56': '33', 'tt': 'vg'}
Best regards,
--
Jérémie