[Python-Dev] Re: Missing arguments in RE functions

Nicolas Fleury nidoizo at yahoo.com
Sat Sep 11 18:01:28 CEST 2004


Guido van Rossum wrote:
> And how is it more consistent that in one form you have to write
> 
> re.compile(r"[a-z]+", re.I).search(line)
> 
> while in the other form you have to write
> 
> re.search(r"[a-z]+", line, re.I)
> 
> ???
> 
> This parameter ordering issue alone makes me cringe at adding the
> flags to the functions.

I agree.  In fact, probably the line parameter should have been the 
first parameter for all functions, but anyway it's too late for that. 
The few times I have not used pattern objects in quick scripts, I always 
put the line at first at the wrong place instinctively, probably for the 
reason you mention (and I'm not pretending my instinct is universal). 
In that context, keeping the API is even more reasonable.

Regards,
Nicolas



More information about the Python-Dev mailing list