Is a variable swap guaranteed to be atomic in python?

Posted by dhruvbird on Stack Overflow See other posts from Stack Overflow or by dhruvbird
Published on 2010-04-12T15:11:52Z Indexed on 2010/04/12 15:12 UTC
Read the original article Hit count: 326

Filed under:
|
|
|

With reference to the following link: http://docs.python.org/faq/library.html#what-kinds-of-global-value-mutation-are-thread-safe

I wanted to know if the following:

(x, y) = (y, x)

will be guaranteed atomic in cPython. (x and y are both python variables)

© Stack Overflow or respective owner

Related posts about python

Related posts about cpython