final question: logging to stdout and updating files

Chris Angelico rosuav at gmail.com
Thu Oct 4 10:27:34 EDT 2012


On Fri, Oct 5, 2012 at 12:00 AM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> That is *terrible* advice. But if you insist on following it, you can
> optimize *any* Python program to this:
>
> # === start code ===
> pass  # this line is optional
> # === end code ===
>
>
> There you go. The most heavily optimized, fastest Python program in
> existence. Sure, it has a few bugs, but boy is it fast!!!

Not many bugs though! I ran it in my Python 5.2.7 for GNU/Windows
256-bit (err, yeah, I borrowed Guido's time machine but had the silly
thing in reverse... oops) and it worked perfectly, except that
indentation has moved from "significant" to "mandatory". When I added
the necessary 5 space indent at the beginning, it correctly created
world peace, ensured that Australia won the next Test Match, and then
printed "Hello, world!\n" to stdout. Unfortunately, a bug in your "end
code" comment meant that the peace it created was by wiping out all
life, but that's pretty minor in the scheme of things.

Optimization really is that important, folks!

ChrisA
may need to schedule surgical detongueing of his cheek



More information about the Python-list mailing list