[pypy-dev] Re: [pypy-svn] r16070 - pypy/dist/pypy/objspace/std

Armin Rigo arigo at tunes.org
Tue Aug 16 21:33:47 CEST 2005


Hi Eric,

On Mon, Aug 15, 2005 at 11:08:51AM +0200, Eric van Riet Paap wrote:
> Or probably better would be that pypy not marks math.log10 as a
> primitive function,
> but math.log10(double) and provide the correct cast from int to double?!?

Indeed.  Our external function table only specifies the return type,
because the annotator can usually find the correct type for the argument
based on the usage.  But this int/float confusion shows a limitation of
this idea.  For now, it will do, as we can use log10(2.0) instead of
log10(2) in the source, as you did.  For the future I guess we should
put this information in the table explicitly (and complain at
annotation-time if the function is called with something that doesn't
match at all).


A bientot,

Armin.



More information about the Pypy-dev mailing list