[Python-Dev] Re: Making custom patterns for string.Template easier

Brett C. bac at OCF.Berkeley.EDU
Sun Sep 5 21:16:50 CEST 2004


Brett C. wrote:
> Barry Warsaw wrote:
> 
>> On Fri, 2004-09-03 at 16:43, Brett C. wrote:
>>
>>
>>> Anyway, I did this partially as an exercise so not a huge deal to me 
>>> if it doesn't make it in, so +0 from me for adding the functionality.
>>
>>
>>
>> So, where's the code?! :)
>>
> 
> Not on SF since the bloody thing is down!  I will stick it up on a 
> patch, assign to you, and report the tracker # here as soon as it is 
> back up.
> 

OK, http://www.python.org/sf/1022698 has the patch.  But  with Tim's 
metaclass solution I don't know how much people will care about this 
one.  =)

I guess the question becomes whether people will prefer to have to 
define a new class to override the regex or do it per instance (I 
suspect the former, although my code does the latter).

If Tim's solution is used I would like to suggest that we also allow for 
overloading the bogus group since that was the last thing in contention 
about the implementation (sans the whole unicode subclass deal).

-Brett


More information about the Python-Dev mailing list