by ditonal · 11y ago · 0 comments
I do agree that OOP approaches can be a bit overused (especially if someone's been coding too much Java), and I've always appreciate that Python doesn't shove it down your throat. I like that you can lean towards more functional code like this example, or towards simple imperative code. But when I do want some classes, I find the Python mechanism mostly ok.
In JavaScript one would have to write: var bound_method = object.method.bind(object);
Python:
func = Foo.method
JavaScript: var func = Function.prototype.call.bind(Foo.prototype.method); " I don't really know much about Python. I only stole its object system for Perl 5. I have since repented."
Larry Wall
http://www.perl.com/pub/2007/12/06/soto-11.html