[Networkit] Containers of libc.stdint types cannot be converted from Python

Hamann, Michael (ITI) michael.hamann at kit.edu
Wed Jul 23 10:10:10 CEST 2014


I have a problem using the integer definitions like uint64_t from 
libc.stdint as template arguments for c++ container types. When using 
something like vector[uint64_t] as return value, there is no problem. 
The vector is automatically converted to its Python equivalent. However 
when using the same type as argument value in a function, this 
conversion doesn't work. Instead (here for a set instead of a vector) I 
get an error message like

Error compiling Cython file:
cdef extern from *:
     ctypedef uint64_t X 'uint64_t'

set.from_py:110:13: 'uint64_t' is not a type identifier

The exactly same code works when using "unsigned long" instead of 

For a concrete example refer to 
- we would like to use "uint64_t" (or rather a ctypedef that refers to 
uint64_t) as argument here. The problem persists when the conversion is 
done explicitly in the cdef class (using <node[uint64_t]> 
degreeSequence) and also when the argument type is already declared in 
the method of the cdef class.

A similar problem was already mentioned 8 months ago in this topic: 

Is this a bug in Cython or is there anything we can do in order to avoid 
this problem? I am using Cython version 0.20.2.

Thank you!


More information about the NetworKit mailing list