> > In what sense are longs not compatible to C integers? > > PyInt_Check() doesn't accept longs. PyInt_AS_LONG() returns > garbage. Since you were proposing a new type, I don't see how that matters. (Making unsigned a subtype of int won't work.) > > I'm frustrated that you apparently didn't read PEP 237 when it was > > discussed in the first place. > > I was on vacation at the time you discussed this and I > had never expected that you are actually trying to force > long usage instead of integer usage. My impression was that > you were aiming at providing ways to be able to pass longs > to integer aware APIs which is goodness. PyInt_AsLong() and the 'i' and 'l' formats to PyArg_Parse* have accepted longs for a long time. The proper idiom is either to use PyArg_Parse* with an 'i' or 'l' format, or to call PyInt_AsLong() *without* first using PyInt_Check(). --Guido van Rossum (home page: http://www.python.org/~guido/)
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