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

Talin talin at acm.org
Thu Dec 7 18:21:22 CET 2006


Fredrik Lundh wrote:
> 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.

Maybe instead of considering a match object to be a sequence, a match 
object should be considered a map? After all, we do have named, as well 
as numbered, groups...?

-- Talin


More information about the Python-Dev mailing list