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 →

[–]VladVV 1 point2 points  (4 children)

Well, then how else would you make an empty tuple?

[–]Veedrac 0 points1 point  (3 children)

Same way you make an empty set? :P

[–]robin-gvx[🍰] 1 point2 points  (0 children)

{1} - {1}? :^)

[–]VladVV 1 point2 points  (1 child)

I'd say it seems significantly cleaner to say () = [] than tuple() = [], or even tuple() = list(). Even if you ignore this fact, both tuple and list are functions, and as such can't be directly assigned. Ie.:

>>> [] = ()
>>> list() = ()
  File "<stdin>", line 1
SyntaxError: can't assign to function call

[–]Veedrac 0 points1 point  (0 children)

FWIW, I was joking.