Why doesn't python's list append() method return the list itself?

Stephen Hansen me+list/python at ixokai.io
Mon Jul 12 01:10:19 EDT 2010


On 7/11/10 10:03 PM, Nathan Rice wrote:
> Yeah, I long ago filed the in place place in the same folder as
> strings-as-sequences, all() returning True for an empty iterable and any
> returning True rather than the thing which triggered it.

You know, the latter two I can see an argument for, and could see the
usefulness therein -- though I've never used either like that, but I
consider that chance. I could see the use (and could readily write my
own all/any in such a case, then keep it in my toolbox).

But the first: what?!

    for ch in data:

is exceptionally useful. Strings-as-sequences I've used hundreds,
thousands of times. I use it constantly.

-- 

   Stephen Hansen
   ... Also: Ixokai
   ... Mail: me+list/python (AT) ixokai (DOT) io
   ... Blog: http://meh.ixokai.io/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 487 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20100711/96176915/attachment.sig>


More information about the Python-list mailing list