Sounds like a bug in IDLE.
What happens if you try it in Windows without IDLE, just using the
standard interactive interpreter?
It works fine without IDLE.
Python 2.7.4 (default, Apr 6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)] on win
32
exec((lambda *fs: reduce(lambda f, g: lambda x: f(g(x)), fs))(*([lambda s: s
[1::2]+s[-2::-2]]*54))('motcye;cye._n8fo_drs(d4+)vle=5 ua.8)(isedamr.ticspt spt
rpi'))True
In IDLE:
exec((lambda *fs: reduce(lambda f, g: lambda x: f(g(x)), fs))(*([lambda s: s[1::2]+s[-2::-2]]*54))('motcye;cye._n8fo_drs(d4+)vle=5 ua.8)(isedamr.ticspt spt rpi'))
10 - 6 == 10 - 5
================================ RESTART ================================
There's a bit of a pause before the RESTART line comes through, and
repeating the equality check after that comes back with a
straight-forward False.
Running IDLE from a terminal gives this:
C:\Documents and Settings\M>\python27\python -m idlelib.idle
----------------------------------------
Unhandled server exception!
Thread: SockThread
Client Address: ('127.0.0.1', 4414)
Request: <socket._socketobject object at 0x0127ADC0>
Traceback (most recent call last):
File "C:\python27\lib\SocketServer.py", line 295, in _handle_request_noblock
self.process_request(request, client_address)
File "C:\python27\lib\SocketServer.py", line 321, in process_request
self.finish_request(request, client_address)
File "C:\python27\lib\SocketServer.py", line 334, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\python27\lib\idlelib\rpc.py", line 503, in __init__
SocketServer.BaseRequestHandler.__init__(self, sock, addr, svr)
File "C:\python27\lib\SocketServer.py", line 649, in __init__
self.handle()
File "C:\python27\lib\idlelib\run.py", line 268, in handle
rpc.RPCHandler.getresponse(self, myseq=None, wait=0.05)
File "C:\python27\lib\idlelib\rpc.py", line 280, in getresponse
response = self._getresponse(myseq, wait)
File "C:\python27\lib\idlelib\rpc.py", line 300, in _getresponse
response = self.pollresponse(myseq, wait)
File "C:\python27\lib\idlelib\rpc.py", line 424, in pollresponse
message = self.pollmessage(wait)
File "C:\python27\lib\idlelib\rpc.py", line 376, in pollmessage
packet = self.pollpacket(wait)
File "C:\python27\lib\idlelib\rpc.py", line 357, in pollpacket
self._stage0()
File "C:\python27\lib\idlelib\rpc.py", line 364, in _stage0
self.bufneed = struct.unpack("<i", s)[0]
error: unpack requires a string argument of length 4
*** Unrecoverable, server exiting!
----------------------------------------
So... I'd say this isn't so much a bug in IDLE as a limitation:
"depends on the universe being sane". I mean, honestly. You just
changed the meaning of four!
ChrisA