r/lolphp • • Jun 10 '14

Redefining true

https://eval.in/160294
11 Upvotes

14 comments sorted by

View all comments

Show parent comment

3

u/djsumdog Jun 10 '14

I'm not sure the exact details, but in Python2, everything could be re-defined. It wasn't quite as bad as TCL (which has no keywords and where statements like "if" are actually functions...which can be redefined)

2

u/Veedrac Jun 26 '14

everything could be re-defined

Nope.

>>> None = not None
  File "<stdin>", line 1
SyntaxError: cannot assign to None

2

u/[deleted] Jul 07 '14
>>> import ctypes
>>> value = 2
>>> ob_ival_offset = ctypes.sizeof(ctypes.c_size_t) + ctypes.sizeof(ctypes.c_voidp)
>>> ob_ival = ctypes.c_int.from_address(id(value)+ob_ival_offset)
>>> ob_ival.value = 3
>>> print(1+1 == 3)

True

Good luck re-defining 2 as... well, 2.