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

Erik Heneryd erik at heneryd.com
Sat Sep 11 18:51:32 CEST 2004


Nicolas Fleury wrote:
> Fredrik Lundh wrote:
> 
>>> I agree.  In fact, probably the line parameter should have been the 
>>> first parameter for all functions
>>
>>
>> so where would you put the pattern?
> 
> 
> Just after.  You "insert" the line parameter first, since it's the 
> additional parameter to the pattern objects functions.  It's basically 
> the input followed by everything to modify/search it.  I think it's 
> better to insert it at first, since it's a mandatory argument, while it 
> can be logical to have optional flags for patterns (and I'm not talking 
> about the current request, but in general in API design).  But again, 
> it's too late for that and I don't pretend my instinct is universal.

compile() doesn't have that many additional parameters, just the 
optional flags.  OTOH the regex object methods do (both mandatory and 
optional).  Wouldn't it be stupid to insert the pattern in the middle of 
the method parameters?


Erik


More information about the Python-Dev mailing list