Class Variable Access and Assignment

Steven D'Aprano steve at REMOVETHIScyber.com.au
Fri Nov 4 21:59:24 EST 2005


On Fri, 04 Nov 2005 18:20:56 -0500, Mike Meyer wrote:

> Steven D'Aprano <steve at REMOVETHIScyber.com.au> writes:
>> equal? Some things are a matter of objective fact: should CPython use a
>> byte-code compiler and virtual machine, or a 1970s style interpreter that
>> interprets the source code directly?
> 
> For the record, I've only seen one interpreter that actually
> interpreted the source directly. Pretty much all of the rest of them
> do a lexical analysis, turning keywords into magic tokens (dare I say
> "byte codes") and removing as much white space as possible. Or maybe
> that's what you meant?

We could argue about details of a throw away line for hours :-)

What I meant was, there is the way Python does it, and then there are (or
were) interpreters that when faced with a block like this:

for i in range(10):
   print i

parses "print i" ten times.

It doesn't really matter whether any interpreters back in the 1970s were
actually that bad, or just toy interpreters as taught about in undergrad
university courses.


-- 
Steven.




More information about the Python-list mailing list