GNU Info

Info Node: (python2.1-api.info)Plain Integer Objects

(python2.1-api.info)Plain Integer Objects


Next: Long Integer Objects Prev: Numeric Objects Up: Numeric Objects
Enter node , (file) or (file)node

Plain Integer Objects
---------------------

`PyIntObject'
     This subtype of `PyObject' represents a Python integer object.

`PyTypeObject PyInt_Type'
     This instance of `PyTypeObject' represents the Python plain
     integer type.  This is the same object as `types.IntType'.

`int PyInt_Check(PyObject* o)'
     Returns true if O is of type `PyInt_Type'.

`PyObject* PyInt_FromLong(long ival)'
     Creates a new integer object with a value of IVAL.

     The current implementation keeps an array of integer objects for
     all integers between `-1' and `100', when you create an int in
     that range you actually just get back a reference to the existing
     object. So it should be possible to change the value of `1'. I
     suspect the behaviour of Python in this case is undefined. :-)

`long PyInt_AsLong(PyObject *io)'
     Will first attempt to cast the object to a `PyIntObject', if it is
     not already one, and then return its value.

`long PyInt_AS_LONG(PyObject *io)'
     Returns the value of the object IO.  No error checking is
     performed.

`long PyInt_GetMax()'
     Returns the system's idea of the largest integer it can handle
     (`LONG_MAX' , as defined in the system header files).


automatically generated by info2www version 1.2.2.9