Dataclass comparison methods giving unexpected results
Advertisements I just learnt how dataclasses work and was messing with it, until I ran into a issue with the comparison logic, the first print prints False, even though it should print True as overall of player1 is equal to player2. Here is the code: from dataclasses import dataclass, field @dataclass(order=True) class Player: overall: int… Read More Dataclass comparison methods giving unexpected results