[pypy-dev] __builtin__ module

Scott Fenton scott at fenton.baltimore.md.us
Wed Jan 22 03:05:14 CET 2003


Hello all. Due to the fact that there's no way
in hell for me to get out of the US by March,
and due to the fact that I love this concept,
I've hacked up some basic replacements for
various functions in __builtin__. The code 
resides at http://fenton.baltimore.md.us/pypy.py
Take a look at it and tell me what you think.

Currenty, this code implements everything BUT:

* the exceptions (seperate concept)
* builtin types (not sure how to handle them)
* callable (not sure how to test)
* classmethod (ditto)
* coerce (tritto)
* compile (needs an actual compiler, and the AST module scares me)
* dir (not sure how to get current scope)
* eval (not my job(TM))
* execfile (ditto(TM))
* hex, oct (lazyness, it'll be in version 2)
* id (lower level than I can handle)
* intern (didn't understand the docstring)
* isinstance, issubclass (see classmethod)
* globals, locals (not sure how to get ahold of them)
* raw_input (really complex)
* staticmethod (ugly hackery)
* super (see classmethod)
* type (need more info, dammit!)
* unichr (given chr, unichr frightens me)
* xrange (sorta builtin type)

-Scott Fenton

-- 
char m[9999],*n[99],*r=m,*p=m+5000,**s=n,d,c;main(){for(read(0,r,4000);c=*r;
r++)c-']'||(d>1||(r=*p?*s:(--s,r)),!d||d--),c-'['||d++||(*++s=r),d||(*p+=c==
'+',*p-=c=='-',p+=c=='>',p-=c=='<',c-'.'||write(1,p,1),c-','||read(2,p,1));}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20030121/27bb7be5/attachment.pgp>


More information about the Pypy-dev mailing list