Against PEP 240

Bernhard Herzog bh at intevation.de
Tue May 29 12:09:46 EDT 2001


Robin Becker <robin at jessikat.fsnet.co.uk> writes:

> In article <0E0E06297253FE1B.D13D6C3BAEE41AD8.4A273FCB042833CB at lp.airnew
> s.net>, Cameron Laird <claird at starbase.neosoft.com> writes
> >Let's be precise:  extensions that pass float-
> >ing point data will all be broken.  I don't
> >regard broken extensions lightly; I know what
> >a cost it can be to reassemble all the parts
> >just to recreate what one had before.  Do you
> >agree there'd be value in adding a coda to the
> >PEP about how to rewrite extensions?  Shall
> >part of the PEP be a function on the C side
> >that helps ease the task?
> >>
> well thinking about this a bit it seems that direct arguments will have
> an f type argument flag and then the conversion should be supplied by
> the interface mechanisms. Indirect arguments will be the problem and
> therefore stuff that used to be fine eg
> 
> myextension.func([1.4,2.3]) will very likely need to be looked at.

Perhaps, but even today, e.g. PyFloat_AsDouble is smart enough to try to
convert its argumen to a float object if it isn't a float object. I'd
expect this function to work with rationals, too.

  Bernhard

-- 
Intevation GmbH                                 http://intevation.de/
Sketch                                 http://sketch.sourceforge.net/
MapIt!                                               http://mapit.de/



More information about the Python-list mailing list