2 + 2 = 5
Mark Lawrence
breamoreboy at yahoo.co.uk
Wed Jul 4 17:24:34 EDT 2012
More information about the Python-list mailing list
Wed Jul 4 17:24:34 EDT 2012
- Previous message (by thread): 2 + 2 = 5
- Next message (by thread): 2 + 2 = 5
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 04/07/2012 20:37, Paul Rubin wrote: > I just came across this (https://gist.github.com/1208215): > > import sys > import ctypes > pyint_p = ctypes.POINTER(ctypes.c_byte*sys.getsizeof(5)) > five = ctypes.cast(id(5), pyint_p) > print(2 + 2 == 5) # False > five.contents[five.contents[:].index(5)] = 4 > print(2 + 2 == 5) # True (must be sufficiently large values of 2 there...) > > Heh. The author is apparently anonymous, I guess for good reason. > The author got confused trying to switch from imperial to metric numbers or vice versa? -- Cheers. Mark Lawrence.
- Previous message (by thread): 2 + 2 = 5
- Next message (by thread): 2 + 2 = 5
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list