3 ms·
This is mostly a java disease, though it affects a few other languages. In python, you wouldn't design this because you can change the implementation of the cl
by dlsspy 16y ago
This is mostly a java disease, though it affects a few other languages. In python, you wouldn't design this because you can change the implementation of the class without having to go and rewrite all the callers.
- dazzawazza 16y agoIn python you can expose and integer within a class and later, when the API changes, convert that exposed integer to a property which upon access invokes a function call. I love this and wish c++ had it. It allows for a much more fluid evolution of the codebase. for more info see here[1], official docs here [2] [1]http://adam.gomaa.us/blog/2008/aug/11/the-python-property-builtin/ http://adam.gomaa.us/blog/2008/aug/11/the-python-property-bu... [2]http://docs.python.org/library/functions.html#property http://docs.python.org/library/functions.html#property