Bug or feature?

Jp Calderone exarkun at intarweb.us
Fri Jan 16 10:36:06 EST 2004


On Fri, Jan 16, 2004 at 08:31:32AM +0000, Dennis Lee Bieber wrote:
> Terry Reedy fed this fish to the penguins on Thursday 15 January 2004 
> 15:39 pm:
> 
> >
> > and returning a value.  I see a little better Guido's reason for having
> > list modification methods return None.  While chaining is not too
> > problematical, object returns would allow list expressions mixing
> > implicit and overt effects with possible puzzles similar to the one
> > presented in this thread.
> >
>         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?
>  
>         jihgfabcdefghijedcba
> or
>         jihgfabcdefghijabcde
> or
>         abcdeabcdefghijabcde
> or
>         abcdeabcdefghijfghij
> 
>         The only "known" is that the middle is supposed to be abcdefghij, but 
> the left and right ends depend solely on order of evaluation...
> 

  http://python.org/doc/current/ref/evalorder.html

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

  Jp




More information about the Python-list mailing list