little problem with list.reverse() function
Roy Smith
roy at panix.com
Sat Sep 11 12:06:03 EDT 2004
More information about the Python-list mailing list
Sat Sep 11 12:06:03 EDT 2004
- Previous message (by thread): little problem with list.reverse() function
- Next message (by thread): ANN: Python Graph Wiki
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
In article <LRE0d.236333$OR2.10714605 at news3.tin.it>, manuel <manuelbastioniNOSPAM at tin.it> wrote: > >>> a = [[1,2],[2,3],[4,5]] > >>> print a > [[1, 2], [2, 3], [4, 5]] > >>> print a.reverse() > None > >>> > > > > ??? > Thanks... The reverse() method of lists reverses the list in-place, and returns None on purpose. Almost everybody finds this surprising when they discover it for the first time. Many people (myself included) consider it a design flaw. But, it is an intentional design decision, not a bug.
- Previous message (by thread): little problem with list.reverse() function
- Next message (by thread): ANN: Python Graph Wiki
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list