[Edu-sig] python versus __python__

Arthur ajsiegel at optonline.net
Sun Oct 23 18:01:12 CEST 2005

Arthur wrote:

>Us non C programmers look forward to PyPy for the view of the netherworld it will
>give us.  In truth I expect PyPy to bring a new burst of creative energy to the
>Python world, just by opening up the possibility of lower level exploration to 
>a wider group of folks.
So I go the next step, download PyPy, and get at app_complex.py  - which 
is the pypy implementation of the Python complex function, implemented 
in Python - all as advertised.

Which is nicely transparent to someone who can read Python well-enough - 
as advertised.

Not too surprisingly, it uses our friend property to implement the read 
only aspect of .real and .imag, so that by simply commenting out the 
property functions I seem to have what I think I want, the ability to 
work with a complex number object, with the ability to write directly to 
.real and .imag.

Probably from there I rename it from "complex" to "Complex" - I like 
case sensitivity for these kind of reasons - so that I remember I am 
working with the Python function not the built-in function, then inherit 
from it as I was intending to do with the builtin, and then plug it into 
PyGeo.  Sacrificing performance - no doubt - with the upside of running 
it through some paces (the pypy module acknowledges it is not well 
tested, and if there are any issues perhaps they will be uncovered, and 
contributing to pypy in any small way seems worthwhile),  seeing if the  
architecture I had in mind is actually sensible, and seeing if I 
discover why there was a decision to make .real,.imag read only as to 
the builtin.

Yup - pypy is going to change things.


More information about the Edu-sig mailing list