▲ | MadVikingGod 9 days ago | |
This behavior can be replicated with any class that has two special methods: __neg__ that returns -1 and __sub__ that accepts ints and returns 1-other. For example if you make this class:
You get similar behavior:
Fun python for everyone. |