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

[Python-Dev] [NPERS] Re: a feature i'd like to see in python #2: indexing of match objects

[Python-Dev] [NPERS] Re: a feature i'd like to see in python #2: indexing of match objectsFredrik Lundh fredrik at pythonware.com
Thu Dec 7 08:15:23 CET 2006
Michael Urman wrote:

> The idea that slicing a match object should produce a match object
> sounds like a foolish consistency to me.

well, the idea that adding m[x] as a convenience alias for m.group(x) 
automatically turns m into a list-style sequence that also has to 
support full slicing sounds like an utterly foolish consistency to me.

the OP's original idea was to make a common use case slightly easier to 
use.  if anyone wants to argue for other additions to the match object 
API, they should at least come up with use cases based on real existing 
code.

(and while you guys are waiting, I suggest you start a new thread where 
you discuss some other inconsistency that would be easy to solve with 
more code in the interpreter, like why "-", "/", and "**" doesn't work 
for strings, lists don't have a "copy" method, sets and lists have 
different API:s for adding things, we have hex() and oct() but no bin(), 
str.translate and unicode.translate take different arguments, etc.  get 
to work!)

</F>

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