[Python-3000] More wishful thinking

Giovanni Bajo rasky at develer.com
Sun Apr 16 17:31:23 CEST 2006


skip at pobox.com wrote:

>     Giovanni> I'm sure you were talking more generically, but as for
>     this Giovanni> specific case (which is indeed very common), I
>     always wondered Giovanni> why re couldn't export wrappers around
>     bound methods of the Giovanni> last match object, so to allow:
> 
>     Giovanni> if re.match(...):
>     Giovanni>    x,y = re.group(1), re.group(2)
>     Giovanni> elif re.match(..):
>     Giovanni>    ...
> 
> Because then the re module wouldn't be thread safe.

Can't you put the global last-match object into TLS?

Giovanni Bajo



More information about the Python-3000 mailing list