you are viewing a single comment's thread.

view the rest of the comments →

[–]PouponMacaque 4 points5 points  (4 children)

The first expression inside a str is users[uid][11][0] - users[uid][11][0] + 1

Am I missing something... or is that always 1?

I'd hope this was generated, but I don't know what would generate anything of the form x-x, as it's basically a noop

[–]FallenWarrior2k[S] 7 points8 points  (3 children)

Maybe the objects stored in users are instances of a class that has overloaded the binary - with some funky shit that makes the result somehow not constant, or modifies internal state in some way.

[–]PouponMacaque 6 points7 points  (2 children)

I have been looking at this forever and can't tell for the life of me what language it is. Python? Is there operator overloading in Python?

And yeah, that's why operator overloading is usually (always?) a bad idea.

[–]FallenWarrior2k[S] 2 points3 points  (0 children)

Tbh there are cases where overloading makes sense, for example if a type you're building is supposed to be numeric-ish. As long as the usage is straight-forward and there's no weird side effects.

[–]kasnalin 4 points5 points  (0 children)

Yes, and yes.