Skip to content

Instantly share code, notes, and snippets.

@qexat
Created February 23, 2023 09:15
Show Gist options
  • Select an option

  • Save qexat/ef763299e5e832a4271b06f980dfbc43 to your computer and use it in GitHub Desktop.

Select an option

Save qexat/ef763299e5e832a4271b06f980dfbc43 to your computer and use it in GitHub Desktop.
Ah yes Python's arrow operator
class hackint(int):
def __neg__(self):
for key, value in globals().items():
if self is value:
globals()[key] = type(self)(self - 1)
return self
x = hackint(5)
while 0 <-- x:
print(x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment