[Cython] Automatic C++ conversions

Sturla Molden sturla at molden.no
Mon Jul 2 14:49:40 CEST 2012


On 30.06.2012 01:06, Stefan Behnel wrote:

>> std::string<=>  bytes
>> std::map<=>  dict
>> iterable =>  std::vector =>  list
>> iterable =>  std::list =>  list
>> iterable =>  std::set =>  set
>> 2-iterable =>  std::pair =>  2-tuple
>
> Very cool.

I think (in C++11) std::unordered_set and std::unordered_map should be 
used instead. They are hash-based with O(1) lookup.

std::set and std::map are binary search threes with average O(log n) 
lookup and worst-case O(n**2).

Also beware that C++11 has a std:tuple type.


Sturla Molden


More information about the cython-devel mailing list