Why does Python mix OO concepts and non OO concepts for operation s on basic types?
James T. Dennis
jadestar at idiom.com
Mon Jun 10 17:45:40 EDT 2002
Steve Holden <sholden at holdenweb.com> wrote:
> "Jarno J Virtanen" <jajvirta at cc.helsinki.fi> wrote ...
>> Wed, 22 May 2002 13:13:06 -0500 Michael Bauers wrote:
>>> Why do you say x = []; x.append('a'), but get the length with len(a) ?
>>> Is there a reason for this sort of inconsistency?
>> why not check the FAQ?
>> http://www.python.org/cgi-bin/faqw.py?req=all#6.5
> I have updated this entry, and would welcome any feedback about the
> changes -- it's just a first attempt, and I was trying not to be too
> defensive about the inconsistencies. After all, history is important even in
> technologies.
> regards
> Steve
Personally I think it would be generally nice if I could
call most of the list and string methods in both ways:
list.append(somelist,someitem) would be the same as:
somelist.append(someitem).
And the obvious:
string.join('',something) would be as: ''.join(something).
(Personally I find the latter rendering to be ugly; a hobgoblin
of consistency).
More information about the Python-list
mailing list