A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2005-August/055828.html below:

[Python-Dev] partition() (was: Remove str.find in 3.0?)

[Python-Dev] partition() (was: Remove str.find in 3.0?)Shane Hathaway shane at hathawaymix.org
Tue Aug 30 17:55:28 CEST 2005
Pierre Barbier de Reuille wrote:
> 
> Shane Hathaway a écrit :
>>Are you sure?  I would instead expect to find a .partition method on a
>>regexp object:
>>
>>  head, sep, tail = re.compile(sep+'.'*offset).partition(some_str)
> 
> 
> Well, to be consistent with current re module, it would be better to
> follow Antoine's suggestion :
> 
> head, sep, tail = re.partition(re.compile(sep+'.'*offset), some_str)

Actually, consistency with the current re module requires new methods to 
be added in *both* places.  Apparently Python believes TMTOWTDI is the 
right practice here. ;-)  See search, match, split, findall, finditer, 
sub, and subn:

http://docs.python.org/lib/node114.html
http://docs.python.org/lib/re-objects.html

Shane
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