Ralf W. Grosse-Kunstleve wrote: > Thanks! This does the trick for me: > > #if PY_VERSION_HEX >= 0x02030000 > PyObject_CallFunction( > (PyObject*) &PyRange_Type, "lll", start, start+len*step, step) > #else > PyRange_New(start, len, step, 1) > #endif > > I am compiling the code above with a C++ compiler (in the context of > Boost.Python). Newer g++ versions unfortunatly produce a warning if -Wall is > specified: > > warning: dereferencing type-punned pointer will break strict-aliasing rules I am not sure about your compiler, but if I remember the standard correctly, the following code shouldn't complain: PyObject_CallFunction((PyObject*) (void *) &PyRange_Type, "lll", start, start+len*step, step) -- Scott David Daniels Scott.Daniels at Acm.Org
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4