Why does Python mix OO concepts and non OO concepts for operation s on basic types?

Roman Suzi rnd at onego.ru
Tue Jun 11 16:20:00 EDT 2002


On Tue, 11 Jun 2002, Don Garrett wrote:

>Hans Nowak wrote:
>> Besides, while Python is object-oriented, that isn't the only
>> paradigm in the language. People coming from a functional
>> background may find the len() function more natural than a
>> method.
>> 
>> YMMV,
>> 
>
>   That's one thing I don't get. Why wasn't len() added as a member to the 
>various types during the recent rework that added so many other members to the 
>native types?

...and what for do we need all those funny slices,
attribute assignments, ..?

a.set(b, c)
print a.get(b)
a.set_b(c)

is much nicer than:

a[b] = c
print a[b]
a.b = c

I also wonder why to contaminate a wonderful language with
all those <, >, &, |, ..., +, - ? Look, how nice these examples are:

a.add(b.multiply(c))

instead of ugly, Perlish, unOOPish:

a + b * c

...

I only forgot how will I do this:

map(string.split, s)

if GvR will deprecate string module...

Sincerely yours, Roman Suzi
-- 
\_ Russia \_ Karelia \_ Petrozavodsk \_ rnd at onego.ru \_
\_ Tuesday, June 11, 2002 \_ Powered by Linux RedHat 7.2 \_
\_ "I can't use Windows. The cat ate my mouse." \_






More information about the Python-list mailing list