Re: a=[1,2,3,4].reverse() - why a is None?

2009-10-13 Thread Simon Forman
On Mon, Oct 12, 2009 at 4:44 AM, Nadav Chernin nada...@qualisystems.com wrote:        Chris Withers wrote:        ...becauase you were looking for:        reversed([1,2,3,4]) OK, but my question is generic. Why when I use object's function that changed values of the object, I can't to get

a=[1,2,3,4].reverse() - why a is None?

2009-10-12 Thread Nadav Chernin
-- http://mail.python.org/mailman/listinfo/python-list

Re: a=[1,2,3,4].reverse() - why a is None?

2009-10-12 Thread Andre Engels
The reverse function is a function to reverse the list in place, not a function to get the reverse of the list: x = [1,2,3,4] y = x z = x.reverse() will result in: x = y = [4,3,2,1] z = None -- André Engels, andreeng...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: a=[1,2,3,4].reverse() - why a is None?

2009-10-12 Thread Erik Max Francis
Andre Engels wrote: The reverse function is a function to reverse the list in place, not a function to get the reverse of the list: x = [1,2,3,4] y = x z = x.reverse() will result in: x = y = [4,3,2,1] z = None .reverse returns None. See the documentation. -- Erik Max Francis

Re: a=[1,2,3,4].reverse() - why a is None?

2009-10-12 Thread Chris Withers
...becauase you were looking for: reversed([1,2,3,4]) Chris -- Simplistix - Content Management, Batch Processing Python Consulting - http://www.simplistix.co.uk -- http://mail.python.org/mailman/listinfo/python-list

RE: a=[1,2,3,4].reverse() - why a is None?

2009-10-12 Thread Nadav Chernin
Chris Withers wrote: ...becauase you were looking for: reversed([1,2,3,4]) OK, but my question is generic. Why when I use object's function that changed values of the object, I can't to get value of it on the fly without writing additional code? a=[1,3,2,4] a.sort()

RE: a=[1,2,3,4].reverse() - why a is None?

2009-10-12 Thread Diez B. Roggisch
Nadav Chernin wrote: Chris Withers wrote: ...becauase you were looking for: reversed([1,2,3,4]) OK, but my question is generic. Why when I use object's function that changed values of the object, I can't to get value of it on the fly without writing additional code? a=[1,3,2,4]

Re: a=[1,2,3,4].reverse() - why a is None?

2009-10-12 Thread Andre Engels
On Mon, Oct 12, 2009 at 10:44 AM, Nadav Chernin nada...@qualisystems.com wrote:        Chris Withers wrote:        ...becauase you were looking for:        reversed([1,2,3,4]) OK, but my question is generic. Why when I use object's function that changed values of the object, I can't to