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/2006-May/065403.html below:

[Python-Dev] Let's stop eating exceptions in dict lookup

[Python-Dev] Let's stop eating exceptions in dict lookup [Python-Dev] Let's stop eating exceptions in dict lookupGuido van Rossum guido at python.org
Tue May 30 05:23:29 CEST 2006
On 5/29/06, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> Fredrik Lundh wrote:
>
> > well, the empty string is a valid substring of all possible strings
> > (there are no "null" strings in Python).  you get the same behaviour
> > from slicing, the "in" operator, "replace" (this was discussed on the
> > list last week), "count", etc.
>
> Although Tim pointed out that replace() only regards
> n+1 empty strings as existing in a string of lenth
> n. So for consistency, find() should only find them
> in those places, too.

And "abc".count("") should return 4.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
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