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. But if I put the property statement first: class C(object): x = property(getx, setx, delx, "I'm the 'x' property.") def getx(self): return self.__x def setx(self, value): self.__x = value def delx(self): del self.__x I get the error: NameError: name 'getx' is not defined Does this violate the principle "Python is not a one pass compiler"? Normally I can use any method of a class anywhere in the definition of the class.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4