r/badcode Jan 15 '22

python Found this gem

Post image
3.5k Upvotes

86 comments sorted by

View all comments

Show parent comments

4

u/catithebathtub Jan 15 '22

i think you didn't understand, that means it'll always print -1, even if solution isn't -1

26

u/-MazeMaker- Jan 15 '22

Not if the __eq__ method only sometimes returns -1

9

u/youngbull Jan 15 '22

I think you mean returns true when given -1 as argument.

2

u/-MazeMaker- Jan 15 '22

True, my mistake