Sign in to follow this  
Alex Pavel

PyModule_AddIntConstat problem

Recommended Posts

The problem here is that Python Integer objects can't hold the full range of an unsigned long. You need a Python Long object instead if the value falls out of range. Use PyLong_FromUnsignedLong() to create the Long object and PyModule_AddObject() to add it to the module. Alternately, if you're on a platform where size_t is at least as large as long, you can try using PyInt_FromSize_t(), which will create an Integer object if the value is small enough and a Long object if the value doesn't fit inside an Integer.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this