1. I've talked off an on about running an Obfuscated Python contest, mostly with some of the PyPy folk like (Laura, Jacob, Alex, Armin, Holger...).

    I'm not really sure crap like this should score higly though :-)

    I think it would be more entertaining if points went to deceptive code: code that looked like it did one thing, but did something else entirely, so code where it was just plain hard to work out what was going on (but a higher-level approach to befuddlement than crazy one liners).

    Maybe I'll try to organize one for the next EuroPython...
      posted by Michael Hudson at 07:05:35 AM on August 12, 2004  
  2. "Crap"?! Harrumph, well, now...

    I just wrote a bit of code that meets the "deceptive" criterion. It replaces sys.stdout with an accumulator-like object, so you can do print 3, print 7, etc, and it's added to the accumulator, rather than printed. flush() actually prints the sum and resets the counter. ...The "problem" is that this code is still very readable, so it's easy to see what's going on. How do you write an obfuscated class? Even if you obfuscate the code in the class, the methods will still be nicely laid out.
      posted by Hans Nowak at 12:30:18 PM on August 12, 2004