Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #24890 > unrolled thread
| Started by | Cameron Simpson <cs@zip.com.au> |
|---|---|
| First post | 2012-07-05 12:06 +1000 |
| Last post | 2012-07-05 12:06 +1000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: 2 + 2 = 5 Cameron Simpson <cs@zip.com.au> - 2012-07-05 12:06 +1000
| From | Cameron Simpson <cs@zip.com.au> |
|---|---|
| Date | 2012-07-05 12:06 +1000 |
| Subject | Re: 2 + 2 = 5 |
| Message-ID | <mailman.1806.1341454467.4697.python-list@python.org> |
On 04Jul2012 19:39, Evan Driscoll <driscoll@cs.wisc.edu> wrote: | On 7/4/2012 14: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. | | Probably just nostalgic for old Fortran, which, supposedly, allowed you | to change the values of literals by passing them to a function by | reference and then modifying the value. Yeah, I was thinking that too. Because all parameters were pass-by-reference in early fortran IIRC. You could, for example, set pi to 3. -- Cameron Simpson <cs@zip.com.au> If I have seen farther than others, it is because I was standing on the shoulders of giants. - Isaac Newton If I have not seen as far as others, it is because giants were standing on my shoulders. - Hal Abelson In computer science, we stand on each other's feet. - Brian K. Reed
Back to top | Article view | comp.lang.python
csiph-web