Who says Python can't be a messy shitheap too? (8)

1 Name: !16UYk8ZTN6 2005-07-20 01:15 ID:Fyda4tqK

Python. It's programmers sometimes like to think that they are different from Perl Programmers because "we don't make big messy shitheaps that other people can't read" and of course, whitespace is suppose to be important.
o rly?

http://infomesh.net/2003/wypy/wy.py.txt

Anyone else have any recent finds of obfuscated Python they would like to share with us?

2 Name: dmpk2k!hinhT6kz2E 2005-07-20 02:57 ID:khrmBjuN

There's a difference between an intentional shitheap and a shitheap that develops that way...

I will say that if that's the worst Python can do, I'm not overly impressed. I don't even know Python yet still have a general understanding of what that snippet does.

3 Name: Albright!LC/IWhc3yc 2005-07-20 10:55 ID:Heaven

Agreed. Obviously, Python doesn't have to look that messy to do the same thing; someone just went out of their way to make it so.

4 Name: dmpk2k!hinhT6kz2E 2005-07-20 14:06 ID:Heaven

I'm interested in the lack of whitespace though. I keep hearing that whitespace is enforced. Does that program run without warnings, and if so, what's the real deal with whitespace and Python?

5 Name: !WAHa.06x36 2005-07-20 15:07 ID:jcIw9lGZ

Python uses whitespace to indicate the block structure. If you can find a way to avoid using blocks entirely, I assume you can just format your code however you want. I know avoiding blocks is fairly easy in Perl, and I'm sure Python has a lot of the same constructs available. I see map being used in there, for instance.

6 Name: Stephen Thorne 2005-07-21 02:57 ID:Heaven

tee hee. jcalderone, aka Exarkun once wrote a chat server in one line.

You can run this code, telnet to hostname:6665 and chat with people. Relies on twisted.

(lambda r,p,b: (r.listenTCP(6665,(type('F',(p.Factory,object),{'protocol':(type('P',(b.LineReceiver,object),{'connectionMade':lambda s:s.factory.c.append(s),'lineReceived':lambda s,m:(s.factory.m(m),None)[1]})),'c':[],'m':lambda s,m:[c.sendLine(m)for c in s.c]}))()),r.run()))(*(lambda p,i:(i(p,'reactor'),i(p,'protocol'),i('twisted.protocols.','basic')))('twisted.internet.',lambda a,b:import(a+b,None,None,b)))

http://www.livejournal.com/users/jcalderone/2660.html

If you've ever heard of 'perl golf', where people compete to write the shortest perl code that completes a task, often producing hideous and hard to understand programs. Over on irc.freenode.net #python, we play a game similar to perl golf.

When people write shitty little obsuficated programs while trying to be clever, everyone tackles them. We call it 'python rugby'.

7 Name: !WAHa.06x36 2005-07-21 13:19 ID:whF+971j

Yeah, that'll teach those people not to try and have fun while programming!

Programming is serious business!

8 Name: #!usr/bin/anon 2005-11-18 18:17 ID:Heaven

>>7 WINS!

This thread has been closed. You cannot post in this thread any longer.