News for hackers. Stuff that matters.
Re:Write More Classes by jerf on Tuesday February 12, 2013 @08:55AM (#5206692)
In Python, the distinction is less strong than it is in some other languages. Since a class can implement __call__, allowing instances to be directly called like a function, even if an API specifies a function, you can pass a class instance in with a suitable __call__. So using functions doesn't have to tie to to it being a function forever and ever in the future (or breaking reverse compatibility, the way it does in most other languages. This isn't a perfect answer to the objections, but the objection is at its most weak in Python.

There are no comments on this comment yet.