Bug or feature?

Skip Montanaro skip at pobox.com
Fri Jan 16 16:44:42 CET 2004

    >> Now that you mention it... Yeah... Can you imagine trying to figure 
    >> out what something like
    >> alist = ['j', 'i', 'h', 'g', 'f', 'e', 'd', 'c', 'b', 'a']
    >> res = alist[:5] + alist.sort() + alist[5:]
    >> was supposed to return?


    >> The only "known" is that the middle is supposed to be abcdefghij, but 
    >> the left and right ends depend solely on order of evaluation...

That's easy.  You get a TypeError exception, because alist.sort() returns

Like Jp said:

    Jp>   Doesn't seem to be a problem, after all.


More information about the Python-list mailing list