views:

115

answers:

2

I'm trying to interface a C++ library (pHash) with Python using Cython, but I have trouble with some of the types. The library functions use "unsigned long long" and I can't find a way to declare variables and parameters with this type. I searched for a list of the types that I can use with cdef but I found nothing. Can anyone point me to such a list (if it exists) or otherwise suggest a way to use 64 bit types in Cython? Thanks.

A: 

I've been able to use both unsigned long long and long long just fine with cdef. See for instance my answer to this question here. I just tried running the same code there with unsigned long long instead of long long and it worked just fine. Can you be more specific about what problems you are having with these types? Maybe you could post some source code that isn't working for you?

Justin Peel
I tried once more and now everything is working. I still can't figure out what I did wrong. Thank you for your reply.
Homayoon
@Homayoon - great, can you please accept this answer then.
joefis
+1  A: 

Here is one of my answers using unsigned long long with cython

http://stackoverflow.com/questions/2119761/simple-python-challenge-fastest-bitwise-xor-on-data-buffers/2174000#2174000

gnibbler