[Python-3000] More wishful thinking

skip at pobox.com skip at pobox.com
Sun Apr 16 23:42:40 CEST 2006


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

    >> What if you're not using threads?

    Giovanni> Hey, that was *my* point.

    Giovanni> For all the Python programs which don't use multi-threading,
    Giovanni> having a global match object is a very important shortcut. 

And it breaks as soon as you decide to use threads.  Suppose I'm writing a
library and want to use regular expressions.  I don't know how my library
will be used (threaded or not).  How should my re code be written, with TLS,
shortcuts or the status quo?  The only safe way to write is the last option.

This really isn't Python 3000 material, folks.  I thought my first response
would trigger an "Oh yeah, I hadn't thought of that", not continual
ill-conceived "yeah, but you can do this instead when the situation is
right".  Please take it c.l.py, hash it out there, and if a reasonable idea
floats to the top of the soup, raise it on python-dev unless the idea is
somehow backward-incompatible and has to wait until Python 3000.

Skip


More information about the Python-3000 mailing list