Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'sys': 0.05; 'subject: + ': 0.07; 'url:github': 0.09; 'cc:addr:python-list': 0.10; 'passing': 0.15; 'value.': 0.15; '(must': 0.16; 'filename:fname piece:signature': 0.16; 'literals': 0.16; 'reason.': 0.16; 'which,': 0.16; 'wrote:': 0.17; 'pfxlen:0': 0.17; 'import': 0.21; 'ctypes': 0.22; 'modifying': 0.22; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'paul': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'values': 0.26; 'guess': 0.27; 'probably': 0.29; 'function': 0.30; 'false': 0.35; 'skip:f 40': 0.35; 'received:192.168.0': 0.35; 'author': 0.37; 'subject:: ': 0.38; 'received:192': 0.39; 'received:192.168': 0.40; 'heh.': 0.84 Date: Wed, 04 Jul 2012 19:39:21 -0500 From: Evan Driscoll User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Paul Rubin Subject: Re: 2 + 2 = 5 References: <7x7guj2u8a.fsf@ruckus.brouhaha.com> In-Reply-To: <7x7guj2u8a.fsf@ruckus.brouhaha.com> X-Enigmail-Version: 1.4.1 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigDBC70ADF71BA56CC7B6C0E7A" Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 46 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1341448814 news.xs4all.nl 6876 [2001:888:2000:d::a6]:40739 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:24888 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigDBC70ADF71BA56CC7B6C0E7A Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 7/4/2012 14:37, Paul Rubin wrote: > I just came across this (https://gist.github.com/1208215): >=20 > import sys > import ctypes > pyint_p =3D ctypes.POINTER(ctypes.c_byte*sys.getsizeof(5)) > five =3D ctypes.cast(id(5), pyint_p) > print(2 + 2 =3D=3D 5) # False > five.contents[five.contents[:].index(5)] =3D 4 > print(2 + 2 =3D=3D 5) # True (must be sufficiently large values of = 2 there...) >=20 > 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. Evan --------------enigDBC70ADF71BA56CC7B6C0E7A Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJP9OJBAAoJEAOzoR8eZTzgPyQH/RYRdhNWV7XjjAg4SgNjt3wj a0KSrKHg8TPKb2Sbj6M+t09UzE6dvwQMpUuO6oviue4pUgrPa9E0OK7TuWYi/3AA J5GoC8xoWuy1t9+7Zu/fBC5ikuwPmDNOLhP0WgPCCdS35EZbNPvVg7FpvsidXeYZ aFUFYi5VvJFmCPIGHFLqsomljMkavOde2ZtuPXSPgp4cBkb0sRxsMebN9xPjRWO9 5Sb6hchtwYZznJpc19WWCMSnIY+Ug30jsdP09dlr8SQf+PalOyBJbM9BoSaQ9NCG ctFB/wDO6zamzr/Ba4vEA+9I6b4hsnjFe6l+1hlUgKBTxfbRqYoA4x6DGoz2Nb0= =MvhR -----END PGP SIGNATURE----- --------------enigDBC70ADF71BA56CC7B6C0E7A--