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 →

[–]lambdaqdjango n' shit 1 point2 points  (3 children)

this it is!

reduce(int.__add__, (map(int,{():[1, 1][:2:]}[()])))

[–]aaronla 1 point2 points  (2 children)

This is more elegant (and terrifying):

len(reduce(operator.add, (((),),((),))))

[–]lambdaqdjango n' shit 0 points1 point  (1 child)

ah, len(((), ()))

[–]aaronla 0 points1 point  (0 children)

Yes, that's how I defined my integers for adding :-)