x = y = z = 'foo'
Idiomatic Python. Coding the smart way.
Seremba John Paul
1.1K8

x = y = z = 'foo'

This is a good style.

Programmer Protection: However, it should be used only for immutable data structures.

If you use this style for mutable data structures like lists, be sure about your intentions.

x = y = z = []
x.append(2)
>>> print(x)
>>> [2]
>>> print(y)
>>> [2]
One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.