[Python-ideas] Python 3000 TIOBE -3%

C. Titus Brown ctb at msu.edu
Mon Feb 13 07:03:50 CET 2012


On Mon, Feb 13, 2012 at 12:57:40AM -0500, Mike Meyer wrote:
> On Sun, 12 Feb 2012 18:36:40 -0800
> "C. Titus Brown" <ctb at msu.edu> wrote:
> 
> > "All of them except subprocess, on some platforms" is the answer, AFAIK.  Which
> > is kind of the point.
> 
> Do you have any documentation to back this up? For instance, The
> collections and random module are both known to have code in them that
> isn't thread safe. For the random module, you can check the docstring:
> 
>     Help on method gauss in module random:
> 
>     gauss(self, mu, sigma) method of random.Random instance
> 	Gaussian distribution.
> 
> 	mu is the mean, and sigma is the standard deviation.  This is
> 	slightly faster than the normalvariate() function.
> 
> 	Not thread-safe without a lock around calls.
> 
> For the collections module, I quote the functools module:
> 
>    lock = Lock()                   # needed because ordereddicts aren't threadsafe
> 
> The argparse and pprint modules both use ordereddicts without either
> locking them providing an explanation as to why they don't need to,
> which makes both of them suspect as well.
> 
> Given those cases, I'm not willing to trust a simple assertion that a
> module is thread-safe, unless it's from the author or a primary
> maintainer of the module, or someone who's actually audited the module
> in question for thread safety.

Good points; I was equating thread safety with not crashing, when I should
have been thinking about consistency in other ways.

thanks,
--titus

p.s. Why did you take a private e-mail response and reply to it to the group?
Bad netiquette & rather rude.  (Private not because I object to being pointed
out as being wrong, but because I'm tired of these long discussions being sent
to python-ideas.)
-- 
C. Titus Brown, ctb at msu.edu



More information about the Python-ideas mailing list