[Python-3000] A request to keep dict.setdefault() in 3.0

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Jul 10 03:16:20 CEST 2007


Phillip J. Eby wrote:
> However, there is another class of use cases which use setdefault for 
> its limited atomic properties - the initialization of non-mutated 
> data structures that are shared among threads.

Isn't it rather dangerous to rely on any built-in
Python operations to be atomic? They might happen
to be, but I don't think there's any guarantee
they will stay that way.

--
Greg


More information about the Python-3000 mailing list