[Python-checkins] CVS: python/dist/src/Objects intobject.c
Barry A. Warsaw
bwarsaw@cnri.reston.va.us
Thu, 10 Jun 1999 19:02:33 -0400 (EDT)
Update of /projects/cvsroot/python/dist/src/Objects
In directory anthem:/projects/python/develop/bwarsaw/src/Objects
Modified Files:
Tag: string_methods
intobject.c
Log Message:
PyInt_FromString(): New API function which converts a string (char*)
into a PyInteger. Arguments are the character string, a char** and
the integer base. base==0 means choose the default base depending on
the leading characters of the string (after stripping the sign), a la
string.atoi(). The second argument returns the character position of
the end of the conversion.
This method encapsulates all the string->int conversions in Python, in
an API that can be used by string.atoi() and int().