ori.livneh at gmail.com
Wed Jan 28 00:15:51 CET 2009
I'm newish to Python, so this might be way off-base, but I think it this
might help: Allen Downey explains in "Think Python" that *"the syntax of a
function call suggests that the function is the active agent."* So you're
calling the function len() and telling it you have an object for it to
measure. By contrast, method invocations suggest that the objects are the
active agents. Python syntax does not always follow this implicit logic, but
I think it makes sense here.
On Tue, Jan 27, 2009 at 5:30 PM, Tobiah <toby at tobiah.org> wrote:
> Just out of curiosity, why was len() made to
> be it's own function? I often find myself
> typing things like my_list.len before I
> catch myself.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list