A PYTHON PREPROCESSOR

Glyph Lefkowitz glyph at twistedmatrix.com
Thu May 18 15:36:54 EDT 2000


Guido van Rossum <guido at python.org> writes:

> Glyph Lefkowitz wrote:
> 
> > Inlining of methods!
> > 
> > Since python variable name / method lookup is so expensive, I believe
> > this would be a significant speedup.  Comments?
> 
> But this would require compile time type analysis.
> Typically, when you see code of the form ``obj.method(arg)'',
> *you* (the programmer) have a good idea of what the class of
> obj would be at run-time -- but the poor Python parser does
> not share this knowledge.

Hmm.  It would be possible to do inlining of functions, though, right?
I suppose this isn't quite the same thing as inlining methods, but it
would still be helpful. (and with the extra "self" argument, you can
make it *behave* like inlined methods)

-- 
                  __________________________________________
                 |    ______      __   __  _____  _     _   |
                 |   |  ____ |      \_/   |_____] |_____|   |
                 |   |_____| |_____  |    |       |     |   |
                 |   @ t w i s t e d m a t r i x  . c o m   |
                 |   http://www.twistedmatrix.com/~glyph/   |
                 `__________________________________________'




More information about the Python-list mailing list