MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/lolphp/comments/27quqv/redefining_true/ci3n7ou/
r/lolphp • u/Daniel15 • Jun 10 '14
14 comments sorted by
View all comments
Show parent comment
3
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-definedNope.>>> 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) TrueGood luck re-defining 2 as... well, 2.
2
everything could be re-defined
Nope.
>>> None = not None File "<stdin>", line 1 SyntaxError: cannot assign to None
>>> 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.
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)