-----Original Message----- From: Kirby Urner [mailto:urnerk@qwest.net]
They're not here to whine about not being mere "math notations" as if that would be an improvement.
That's one way to attempt to characterize my point - or Graham's point, for that matter. Except that it of course misses the point. And is a bit obnoxious. The usual. My target, if anything, is not Python - but the pressure on it to be more Java and C# like. But more to my point is the fact that I don't expect my programming language to solve the problem of decoupling my API from my code. Because I don't expect it to be a solvable problem. Seems to me to make more sense if my programming language provides the environment for deriving concrete solutions to defined problems. And project management tools (and human beings interacting with human beings) manage phase-in and change. Whatever. Art
Arthur wrote:
... more to my point is the fact that I don't expect my programming language to solve the problem of decoupling my API from my code. Because I don't expect it to be a solvable problem.
I don't know if I'm beating a dead horse, but I don't claim properties solves the problem of decoupling an API from its current implementation. I do claim it provides another tool to express a properly decoupled API. --Scott David Daniels Scott.Daniels@Acm.Org
-----Original Message----- From: edu-sig-bounces@python.org [mailto:edu-sig-bounces@python.org] On Behalf Of Scott David Daniels
Arthur wrote:
... more to my point is the fact that I don't expect my programming language to solve the problem of decoupling my API from my code. Because I don't expect it to be a solvable problem.
I don't know if I'm beating a dead horse, but I don't claim properties solves the problem of decoupling an API from its current implementation. I do claim it provides another tool to express a properly decoupled API.
Yup. You're beating a dead horse. Everything I can find about properties in Java and C# relate it to encapsulation and data hiding. Everything I can find about Python relate that the language does not attempt to support encapsulation and data hiding in the Java and C# sense. I might be a dead horse who is dead wrong, but the issue about how properties fit into Python is certainly not straightforward in the least, and responding as if it were is grossly unfair - to the question raised. Art
I might be a dead horse who is dead wrong, but the issue about how properties fit into Python is certainly not straightforward in the least, and responding as if it were is grossly unfair - to the question raised.
Art
I think use cases were described, and demonstrated, in which the property feature made sense, e.g. we wanted an attributes-based API into our triangle object, but sometimes the results were computed on the fly. Martelli shows this same use case with a rectangle object (Python in a Nutshell, pg. 85). As for using decorator syntax to define properties, Scott has shown how this might be done. However, this approach is entirely optional. Python coders may flag private attributes and methods with _ and __, with the latter causing name mangling based on class name:
class Foo(object): def __hidden(self): pass
dir(Foo) ['_Foo__hidden'...]
Kirby
participants (3)
-
Arthur -
Kirby Urner -
Scott David Daniels