[Python-ideas] Fwd: Concurrent safety?

Stephen J. Turnbull stephen at xemacs.org
Wed Nov 2 02:45:42 CET 2011


Mike Meyer writes:
 > On Tue, Nov 1, 2011 at 11:05 AM, Stephen J. Turnbull <stephen at xemacs.org>wrote:

 > > 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?

No, "forcing" is.  Consenting adults and all that.

 > 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.

Anybody who does that is simply shutting off the warning/errors, and
clearly is not thinking about their app at all.

But this is revealing: you say *your* goal is making *me* think.
That's what I consider un-Pythonic.

A Pythonic approach would allow me to worry about it when *I* think it
necessary.  Maybe we don't have that choice, maybe concurrency is too
hard to solve without some annoying constraints.  But that's not at
all clear to me, and I'd rather make gradual progress toward safety in
a language that's fun and profitable to use, rather than have safety
in a language that is a pain in the neck to use.




More information about the Python-ideas mailing list