Thoughts about Python

Aahz aahz at pythoncraft.com
Tue Feb 24 10:49:21 EST 2004


In article <15c2d03b.0402240311.395f5382 at posting.google.com>,
Marco Aschwanden <PPNTWIMBXFFC at spammotel.com> wrote:
>
>*** Problem: Many builtins are not necessary
>
>Many builtins are not necessary. To name a few: min / max / len
>
>This functions should be defined on the class:
>
>["I", "like", "Python"].len()
>"I".len()
>{1:"I", "2":"like", 3:"Python"}.len()
>(1,2,3,4).len()
>
>"Throwing away" this builtins would flatten the alreay flat learning
>curve once more (you don't have to learn that many builtins) ... these
>functions belong to the class and they are naturally expected there.
>One weakness of a language as (Visual)Basic, PHP, ... is its payload
>of available functions... Python's OO helps here to diminish the need
>for lots of functions.

"Practicality beats purity"; if you're not familiar with that, start up
an interactive Python session and type "import this".

In this case, this means that Guido thinks that len() is such a common
usage that it works better as a function than a method.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"Do not taunt happy fun for loops. Do not change lists you are looping over."
--Remco Gerlich, comp.lang.python



More information about the Python-list mailing list