[Python-ideas] Fwd: Concurrent safety?
Mike Meyer
mwm at mired.org
Tue Nov 1 22:13:07 CET 2011
On Tue, Nov 1, 2011 at 11:05 AM, Stephen J. Turnbull <stephen at xemacs.org>wrote:
> Mike Meyer writes:
> > The proposed change doesn't prevent users from doing dangerous (and even
> > ugly things).
> I didn't say it did, it "merely" imposes substantial inconvenience in
> hope that:
> > It just forces them to *think* about what they're doing beforehand.
> which I believe to be un-Pythonic.
>
Really? Thinking is unpythonic?
> But you say that you have an approach in mind which is reasonably
> performant and doesn't change things too much for single-threaded
> apps, which would make the discussion moot. So let's see how that
> works out.
>
If all you want to do is get the old semantics back in a single-threaded
application, you could do something like turning:
if __name__ == '__main__':
main()
into:
if __name__ == '__main__':
locking:
main()
Actually, that achieves my goal - you hopefully thought about this long
enough to realize that this was safe before doing it.
<mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20111101/b7c71802/attachment.html>
More information about the Python-ideas
mailing list