Re: [Python-Dev] Example for "property" violates "Python is not a one pass compiler"

2005-09-06 Thread Greg Ewing
Nick Coghlan wrote: > It builds the symbol table before actually trying to compile anything. This > is > what allows it to figure out which load commands to use for which symbols. Yes, nowadays I expect it makes two passes over the parse tree for each function, one to build the symbol table and

Re: [Python-Dev] Example for "property" violates "Python is not a one pass compiler"

2005-09-06 Thread Nick Coghlan
Greg Ewing wrote: > Phillip J. Eby wrote: > >>I'm not sure where you got the "Python is not a one pass compiler" idea; I >>don't recall having seen this meme anywhere before, and I don't see how >>it's meaningful anyway. > > > Indeed, Python's bytecode compiler essentially *is* > a one-pass co

Re: [Python-Dev] Example for "property" violates "Python is not a one pass compiler"

2005-09-06 Thread Fredrik Lundh
Greg Ewing wrote: > Indeed, Python's bytecode compiler essentially *is* > a one-pass compiler for a suitable setting of the "look-ahead window size", at least. some Python constructs cannot be compiled by a truly minimalistic one-pass compiler. _

Re: [Python-Dev] Example for "property" violates "Python is not a one pass compiler"

2005-09-06 Thread Greg Ewing
Phillip J. Eby wrote: > I'm not sure where you got the "Python is not a one pass compiler" idea; I > don't recall having seen this meme anywhere before, and I don't see how > it's meaningful anyway. Indeed, Python's bytecode compiler essentially *is* a one-pass compiler (or at least it used to b

Re: [Python-Dev] Example for "property" violates "Python is not a one pass compiler"

2005-09-05 Thread Phillip J. Eby
At 12:04 PM 9/5/2005 -0400, Edward C. Jones wrote: >Normally I can use any method of a class anywhere in the definition of >the class. Not true. You can certainly use any method of a class in any *functions* or methods defined in the body of the class. But you can't use them in the body of the

[Python-Dev] Example for "property" violates "Python is not a one pass compiler"

2005-09-05 Thread Edward C. Jones
Here is an example from the "Python Library Reference", Section 2.1 "Built-in Functions": class C(object): def getx(self): return self.__x def setx(self, value): self.__x = value def delx(self): del self.__x x = property(getx, setx, delx, "I'm the 'x' property.") It works. Bu