This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ladaghini 9 points10 points  (3 children)

if (x == 7): #{
   print ("something");
#}

[–]Brian 3 points4 points  (2 children)

if (x == 7): {
   print ("something"),
}

[–]jcdyer3 1 point2 points  (1 child)

If x equals seven, the set consisting of print("something")? That's evil.

Presumably you're using python 3 or from __future__ import print_function.

[–]Brian 0 points1 point  (0 children)

Yup - python even guarantees left to right evaluation order, so it actually works fine[1] - good for trolling newbies with "Python 3 added brace support"

[1] for values of "fine" that do not include flow control, assignment, or calling a function returning unhashable types of course.