[Tutor] Interpreter level objects

Jacob S. keridee at jayco.net
Thu Feb 24 02:11:11 CET 2005


Hi everyone!

    Let's see, my topic of discussion for today is this.

If the psyco package can work on an interpreter level--I don't know if 
that's the right terminology, but this is what it does.

Say I put the code

import psyco
psyco.full()

in sitecustomize.py
and run a random file that I have already got an average execution time of.
Then I run it again, with the above implemented. My execution time is has 
dropped.
Which brings me to believe that psyco monitors all subprocesses and all 
subobjects.
So this being the case, why haven't the volunteers set up from __import__ 
division so that you can put it in sitecustomize.py and get it to run 
whenever you start python?
I know why it doesn't work,... because division is in the sitecustomize 
namespace. But why didn't they set it up like the psyco people (no pun 
intended--but it is pretty funny) did?

Anyways, this all came up because several modules that used psyco.full() 
would greatly be hindered if they imported another module that did the same. 
So I got the great idea, why not put it in sitecustomize.py? Then I got the 
idea, why not put from __import__ division in the sitecustomize.py, too? 
psyco.full() worked, from __import__ division did not.

Any ideas?
Jacob 



More information about the Tutor mailing list