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/055913.html below:

[Python-Dev] Proof of the pudding: str.partition()

[Python-Dev] Proof of the pudding: str.partition() [Python-Dev] Proof of the pudding: str.partition()Bill Janssen janssen at parc.com
Wed Aug 31 22:04:55 CEST 2005
> >    (*) Regular Expressions
> 
> This can be orthogonally added to the 're' module, and definitely should 
> not be part of the string method.

Sounds right to me, and it *should* be orthogonally added to the 're'
module coincidentally simultaneously with the change to the string
object :-).

I have to say, it would be nice if

       "foo bar".partition(re.compile('\s'))

would work.  That is, if the argument is an re pattern object instead
of a string, it would be nice if it were understood appropriately,
just for symmetry's sake.  But it's hardly necessary.

Presumably in the re module, there would be a function like

	re.partition("\s", "foo bar")

for one-shot usage, or the expression

        re.compile('\s').partition("foo bar")

Bill
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