PyNumber_Int screwing Object.

Tim Peters at
Tue Oct 7 05:15:59 CEST 2003

>> You can never skip these checks.

[José Rui Faustino de Sousa]
> I will keep that in mind!
> This is not my code and I am completely ignorant of the Python/C API I
> was just looking into the source of some really weird behaviour at a
> much higher level...
> That "PyNumber_Int" sure did look armless and it was some rough
> debugging session...
> By the way is there any nice tutorial on how to (properly) write this
> kind of stuff... I kinda got hooked... ;-)

Well, I don't know of a tutorial, but programmers suffering from C addiction
<wink> usually want examples more than text.  Python itself is choked with
examples:  the Modules and Objects directories of the Python source
distribution are full of examples of "extending" Python.  Most modules and
builtin types don't have any special privileges -- if they didn't exist, you
could write them and link them into Python yourself.

Note two of the manuals in the standard Python doc set:

    Extending and Embedding
    Python/C API

This first one walks you through some simple examples, and arguably is a
tutorial; the second is more of a reference manual.

More information about the Python-list mailing list