A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/067876.html below:

Stepping backwards in for loop?

Stepping backwards in for loop? Stepping backwards in for loop?Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Sat Apr 14 18:37:15 EDT 2001
Sat, 14 Apr 2001 13:37:54 -0300, Carlos Ribeiro <cribeiro at mail.inet.com.br> pisze:

> It would be a *lot* easier if strings had a reverse method, or if the 
> reverse() methods returned the reversed string. However, similarly to 
> sort(), the Python-way-of-doing-things must have some good reason for 
> reverse() to behave this way (as a inplace operation on the list).

I don't think there is a deep reason, except some efficiency.
The functional style would provide these operations as returning
new versions.

They could be added to Python under names reversed() and sorted()
to avoid confusion.

-- 
 __("<  Marcin Kowalczyk * qrczak at knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK

More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4