[Python-ideas] The "in"-statement
Joao S. O. Bueno
jsbueno at python.org.br
Wed Nov 7 03:00:12 CET 2012
On 6 November 2012 20:17, Calvin Spealman <ironfroggy at gmail.com> wrote:
>
> in obj_1:
> in obj_2:
> a = b
>
> Tell me what this does, then.
>
I think it is quite clear the snippet above should be equivalent to:
from itertools import product
from os import fork
for combination in product(obj1, obj2):
pid = fork()
if pid == 0:
setattr(combination[0], "a", getattr(combination[1], "b") )
break
-------
Actually near equivalent - it would be more proper if we had a fork
variant where each subproccess would
run in a different parallel universe. Maybe when Python 5 be
overhauled to be optimized for quantum computing we can get close
enough.
js
-><-
More information about the Python-ideas
mailing list