[Python-Dev] str(1L) -> '1' ?

M.-A. Lemburg mal@lemburg.com
Mon, 27 Dec 1999 13:51:36 +0100


Greg Stein wrote:
> 
> On Sun, 26 Dec 1999, M.-A. Lemburg wrote:
> > Greg Stein wrote:
> > > On Fri, 24 Dec 1999, M.-A. Lemburg wrote:
> > > > While we're at it: how about adding a PyLong_AsString() API
> > > > to the C interface ? I currently use PyObject_Str() in mxODBC
> > > > and then slice off the 'L' -- not very elegant. A PyLong_AsString()
> > > > API would much better suit the task.
> > >
> > > Fred just checked in a change yesterday. PyObject_Str() on a Long no
> > > longer includes the 'L'.
> >
> > Ah, ok... scanning the patches: they don't provide an externed
> > C interface... I would like to have such a beast if possible
> > (basically, the new long_format() as PyLong_AsString()).
> 
> What's wrong with PyObject_Str()? I don't see a need for Yet Another Entry
> Point.

What's wrong with a rich C API :-) ?

The long_format function would be very useful for programs
interacting with other software at C level. Making it
external would give the programmer the ability to pass
long string representations in any base to other programs,
which is very useful for e.g. database interaction or
crypto software.

-- 
Marc-Andre Lemburg
______________________________________________________________________
Y2000:                                                     4 days left
Business:                                      http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/