Re: using reverse in list of tuples

2010-06-10 Thread Steven W. Orr
On 06/10/10 04:41, quoth Marco Nawijn: > On Jun 10, 2:39 am, james_027 wrote: >> hi, >> >> I am trying to reverse the order of my list of tuples and its is >> returning a None to me. Is the reverse() function not allow on list >> containing tuples? >> >> Thanks, >> James > > As the others already

Re: using reverse in list of tuples

2010-06-10 Thread Marco Nawijn
On Jun 10, 2:39 am, james_027 wrote: > hi, > > I am trying to reverse the order of my list of tuples and its is > returning a None to me. Is the reverse() function not allow on list > containing tuples? > > Thanks, > James As the others already mentioned list.reverse() is in-place, just as for ex

Re: using reverse in list of tuples

2010-06-09 Thread Terry Reedy
On 6/9/2010 8:39 PM, james_027 wrote: hi, I am trying to reverse the order of my list of tuples and its is returning a None to me. Is the reverse() function not allow on list containing tuples? No. Mutation methods of builtins generally return None. -- http://mail.python.org/mailman/listinfo

Re: using reverse in list of tuples

2010-06-09 Thread rantingrick
On Jun 9, 7:39 pm, james_027 wrote: > > I am trying to reverse the order of my list of tuples and its is > returning a None to me. Is the reverse() function not allow on list > containing tuples? list.revese() is an in-place operation! don't try to assign the return value back to your list! >>>

Re: using reverse in list of tuples

2010-06-09 Thread Dan Stromberg
$ python Python 2.5.1 (r251:54863, Nov 2 2007, 11:57:24) [GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-52)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> list_ = [(1,2), (3,4), (5,6)] >>> print list_.reverse() None >>> print list_ [(5, 6), (3, 4), (1, 2)] >>> On

using reverse in list of tuples

2010-06-09 Thread james_027
hi, I am trying to reverse the order of my list of tuples and its is returning a None to me. Is the reverse() function not allow on list containing tuples? Thanks, James -- http://mail.python.org/mailman/listinfo/python-list