repl.it
@LogikLogicus/

OverrideIdentity

Python 2.7

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
toggle = True

# Intentionally overriding id() to make a fool
# out of Speakpigeon
def id(_):
  global toggle;
  # flip-flop-flip-flop
  toggle = not toggle
  return toggle

A = 1
print(id(A) == id(A))
print(A == A)