logo       

Python and std::vector<unsigned long>: msg#00093

programming.swig

Subject: Python and std::vector<unsigned long>

Hello,
why is the template specialization of std::vector<unsigned long> done with
PyInt_* functions? If you use an unsigned long, you normally expect that the
value might be greater than the greatest signed long. In case of such big
integers you have then negative integers if you use PyInt. The disadvantage
of PyLong is the size increase and I suppose slower computation. Does anyone
now how to use PyInt and interpret them as unsigned in Python?

namespace std {
specialize_std_vector(unsigned long,PyInt_Check, \
PyInt_AsLong,PyInt_FromLong);
}

Ciao
_______________________________________________
Swig maillist - Swig@xxxxxxxxxxxxxxx
http://mailman.cs.uchicago.edu/mailman/listinfo/swig



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise