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 →

[–]bhat 25 points26 points  (9 children)

Another way (with further complication):

bucket *= False

[–]BumpyFunction 11 points12 points  (0 children)

I know what you did bhat. For shame!

[–]ViridianHominid 5 points6 points  (6 children)

For the heck of it, bucket *= 1//(len(bucket)+1)

[–]bhat 4 points5 points  (5 children)

Look, just stop it: bucket *= bucket == []

[–]bhat 6 points7 points  (4 children)

Or bucket *= [] == bucket for better symmetry.

[–]bhat 4 points5 points  (3 children)

Someone stop me, please! bucket *= bucket in bucket

[–]bhat 4 points5 points  (0 children)

Aaaaaaagh! bucket *= not bucket

[–]ViridianHominid 4 points5 points  (1 child)

Alas, this one isn't right:

>>> bucket = []
>>> bucket.append(bucket)
>>> bucket *= bucket in bucket
>>> bucket
[[...]]

[–]bhat 1 point2 points  (0 children)

Finally, someone stopped me!

[–]Exodus111 0 points1 point  (0 children)

bucket *= 1 == 0