[pypy-dev] __builtin__ module

holger krekel hpk at trillke.net
Fri Jan 24 14:48:42 CET 2003


[Scott Fenton Fri, Jan 24, 2003 at 07:43:13AM -0500]
> On Fri, Jan 24, 2003 at 10:39:35AM +0100, Armin Rigo wrote:
> 
> > About chr(i) vs. '%c'%i vs. '\x00\x01...\xFF'[i]:  what I feel this shows is 
> > that one of these solutions must be thought as the primitive way to build a 
> > character, and the others should use it; and I definitely feel that chr() is 
> > the primitive way to build a character.  Contrary to what I said in a previous 
> > e-mail I don't think that chr() should be implemented with '%c'%i.  On the 
> > other hand, I guess that the strings' % operator could nicely be implemented 
> > in pure Python.  It would then have to use chr() to implement the %c format 
> > code.  It looks more reasonable than the other way around.
> > 
> 
> I disagree. My feeling about this is probably that everything that can
> be expressed as a function should be in pure python,

what do you mean by this?  "everything" can always be expressed in 
a python function.  It's a matter of time and space so could you
be more specific? 

Anyway, I would try very hard to express all the builtins in python. 
And i see Thomas Heller's ctypes approach as a way to make 
this possible.  Before coding anything in C there must be a 
real *need* to do so. 

greetings,

    holger


More information about the Pypy-dev mailing list