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

Bjorn Pettersen BPettersen at NAREX.com
Tue Jun 11 01:00:30 CEST 2002


> From: James T. Dennis [mailto:jadestar at idiom.com] 
> 

[snip]

> 
> 	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).

Your wish is granted:

>>> x = []
>>> list.append(x, 5)
>>> x
[5]
>>> str.join(' ', ['a', 'b', 'c'])
'a b c'
>>>

not-that-I-would-ever-do-something-like-that'ly y'rs
-- bjorn





More information about the Python-list mailing list