A RetroSearch Logo

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

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2013-June/126869.html below:

[Python-Dev] Clean way in python to test for None, empty, scalar, and list/ndarray? A prayer to the gods of Python

[Python-Dev] Clean way in python to test for None, empty, scalar, and list/ndarray? A prayer to the gods of PythonTerry Reedy tjreedy at udel.edu
Sat Jun 15 22:11:59 CEST 2013
On 6/15/2013 8:53 AM, Tres Seaver wrote:

> In fifteen years of Python programming, I have literally *never* wanted
> to iterate over 'str' (or now 'bytes').

If so, it is because you have always been able to use pre-written 
methods and functions that internally do the iteration for you.

 > I've always considered the fact
> that Python made them iterable by default (rather than e.g. defining a
> method / property to get to an iterable "view" on the underlying string)

.__iter__ is that method.

But this is off-topic for pydev.

-- 
Terry Jan Reedy

More information about the Python-Dev 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