On 5/29/06, Greg Ewing <[EMAIL PROTECTED]> 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/) _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com