Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #30730
| References | <mailman.1781.1349320295.27098.python-list@python.org> <mailman.1797.1349357671.27098.python-list@python.org> <506d967a$0$29978$c3e8da3$5496439d@news.astraweb.com> |
|---|---|
| Date | 2012-10-05 00:27 +1000 |
| Subject | Re: final question: logging to stdout and updating files |
| From | Chris Angelico <rosuav@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1800.1349360858.27098.python-list@python.org> (permalink) |
On Fri, Oct 5, 2012 at 12:00 AM, Steven D'Aprano <steve+comp.lang.python@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
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
final question: logging to stdout and updating files "Littlefield, Tyler" <tyler@tysdomain.com> - 2012-10-03 21:11 -0600
Re: final question: logging to stdout and updating files Ramchandra Apte <maniandram01@gmail.com> - 2012-10-04 00:53 -0700
Re: final question: logging to stdout and updating files Ramchandra Apte <maniandram01@gmail.com> - 2012-10-04 00:53 -0700
Re: final question: logging to stdout and updating files Ramchandra Apte <maniandram01@gmail.com> - 2012-10-04 06:34 -0700
Re: final question: logging to stdout and updating files Ramchandra Apte <maniandram01@gmail.com> - 2012-10-04 06:34 -0700
Re: final question: logging to stdout and updating files Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-10-04 14:00 +0000
Re: final question: logging to stdout and updating files Chris Angelico <rosuav@gmail.com> - 2012-10-05 00:27 +1000
RE: final question: logging to stdout and updating files "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-10-04 22:36 +0000
Re: final question: logging to stdout and updating files Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-10-05 09:11 +0100
Re: final question: logging to stdout and updating files Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-10-05 09:19 +0100
Re: final question: logging to stdout and updating files Ramchandra Apte <maniandram01@gmail.com> - 2012-10-05 06:32 -0700
Re: final question: logging to stdout and updating files Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-10-04 14:52 +0000
csiph-web