As a commenter there noted,
[thing] = stuff
works too. I think I like that even better.
[thing] = stuff
works too. I think I like that even better.
There doesn't appear to be any difference in speed between the two. Assigning the result to one variable (totally different to this) is about 6% faster, so this syntax is what I'll use, thank you!
On your exact machine with your exact version of Python, today.
Please don't let microbenchmarks dictate what code you write. If you need a 6% performance gain in a microbenchmark, you've chosen the wrong language to use. Python is about readability and maintainability, not syntax hacks to make some benchmark slightly faster.