Re: Don't you just love writing this sort of thing :)

2008-12-10 Thread Tim Rowe
2008/12/9 Ethan Furman [EMAIL PROTECTED]: Not all code has to be written for everyone. Not all code will be read by the masses. Some code you write for yourself... an expression of who you are, how you think... While my own quirks are not as visually entertaining, I think it's another

Re: gzip.GzipFile (was Re: Don't you just love writing this sort of thing :))

2008-12-09 Thread Jorgen Grahn
On Mon, 08 Dec 2008 14:21:40 +, MRAB [EMAIL PROTECTED] wrote: Jorgen Grahn wrote: On Sat, 06 Dec 2008 10:01:10 +, Arnaud Delobelle [EMAIL PROTECTED] wrote: ... Why use (open, gzp.GzipFile)[Entry.endswith(.gz)] when we have had contitional expressions for a few years now? Instead,

Re: Don't you just love writing this sort of thing :)

2008-12-09 Thread Ethan Furman
Lawrence D'Oliveiro wrote: for \ Entry \ in \ sorted \ ( f for f in os.listdir(PatchesDir) if PatchDatePat.search(f) != None ) \ : Patch = (open, gzip.GzipFile)[Entry.endswith(.gz)](os.path.join(PatchesDir, Entry), r) ... read from

gzip.GzipFile (was Re: Don't you just love writing this sort of thing :))

2008-12-08 Thread Jorgen Grahn
On Sat, 06 Dec 2008 10:01:10 +, Arnaud Delobelle [EMAIL PROTECTED] wrote: ... Why use (open, gzp.GzipFile)[Entry.endswith(.gz)] when we have had contitional expressions for a few years now? Instead, you can write (gzip.GzipFile if entry.endswidth(.gz) else open). I think it will be

Re: Don't you just love writing this sort of thing :)

2008-12-08 Thread Gabriel Genellina
En Sun, 07 Dec 2008 05:34:39 -0200, Lawrence D'Oliveiro [EMAIL PROTECTED] escribió: In message [EMAIL PROTECTED], Arnaud Delobelle wrote: * you give the impression of being arrogant; Oddly enough, I wasn't the one who started by criticizing other people's code. I have no ego about my

Re: gzip.GzipFile (was Re: Don't you just love writing this sort of thing :))

2008-12-08 Thread Bruno Desthuilliers
Jorgen Grahn a écrit : (snip) Also, making a decision based on the .gz part of the name isn't always correct -- you miss files named foo.Z and similar. .tgz anyone ? /Jorgen -- http://mail.python.org/mailman/listinfo/python-list

Re: gzip.GzipFile (was Re: Don't you just love writing this sort of thing :))

2008-12-08 Thread MRAB
Jorgen Grahn wrote: On Sat, 06 Dec 2008 10:01:10 +, Arnaud Delobelle [EMAIL PROTECTED] wrote: ... Why use (open, gzp.GzipFile)[Entry.endswith(.gz)] when we have had contitional expressions for a few years now? Instead, you can write (gzip.GzipFile if entry.endswidth(.gz) else open).

Re: Don't you just love writing this sort of thing :)

2008-12-08 Thread Gabriel Genellina
En Sun, 07 Dec 2008 05:34:39 -0200, Lawrence D'Oliveiro [EMAIL PROTECTED] escribió: In message [EMAIL PROTECTED], Arnaud Delobelle wrote: * you give the impression of being arrogant; Oddly enough, I wasn't the one who started by criticizing other people's code. I have no ego about my

Re: Don't you just love writing this sort of thing :)

2008-12-07 Thread Arnaud Delobelle
Lawrence D'Oliveiro [EMAIL PROTECTED] writes: In message [EMAIL PROTECTED], Arnaud Delobelle wrote: * you seem to disregard the fact that in 'programming language' there is the word 'language'. A language is a way to _communicate_ information, in the case of a programming language

Re: Don't you just love writing this sort of thing :)

2008-12-07 Thread Rhodri James
On Sun, 07 Dec 2008 07:27:51 -, Lawrence D'Oliveiro [EMAIL PROTECTED] wrote: In message [EMAIL PROTECTED], Rhodri James wrote: Yes, it's very pretty, and you're terribly clever. In six months' time when you come back to make some engineering change and have to sit down and break it

Re: Don't you just love writing this sort of thing :)

2008-12-06 Thread Arnaud Delobelle
Lawrence D'Oliveiro [EMAIL PROTECTED] writes: In message [EMAIL PROTECTED], Aaron Brady wrote: On Dec 5, 4:32 am, Lawrence D'Oliveiro [EMAIL PROTECTED] central.gen.new_zealand wrote: The code people write is probably a direct reflection of their thinking processes: For example, slow,

Re: Don't you just love writing this sort of thing :)

2008-12-06 Thread Andreas Waldenburger
On Sat, 06 Dec 2008 20:28:17 +1300 Lawrence D'Oliveiro [EMAIL PROTECTED] wrote: Does that make any sense to you, or should I start drawing simple diagrams? People, please! Is some civility too much to ask? /W -- My real email address is constructed by swapping the domain with the recipient

Re: Don't you just love writing this sort of thing :)

2008-12-06 Thread Aaron Brady
On Dec 5, 7:20 pm, Lawrence D'Oliveiro [EMAIL PROTECTED] central.gen.new_zealand wrote: In message [EMAIL PROTECTED], Aaron Brady wrote: On Dec 5, 4:32 am, Lawrence D'Oliveiro [EMAIL PROTECTED] central.gen.new_zealand wrote: The code people write is probably a direct reflection of their

Re: Don't you just love writing this sort of thing :)

2008-12-06 Thread Rhodri James
On Sat, 06 Dec 2008 01:20:55 -, Lawrence D'Oliveiro [EMAIL PROTECTED] wrote: Do you find this (open, gzip.GzipFile)[Entry.endswith(.gz)](os.path.join(PatchesDir, Entry), r) complicated or hard to understand? It's made up of very simple pieces, combined according to very simple

Re: Don't you just love writing this sort of thing :)

2008-12-06 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Rhodri James wrote: Yes, it's very pretty, and you're terribly clever. In six months' time when you come back to make some engineering change and have to sit down and break it back down into those simple pieces to remind yourself what it's doing, pretty and

Re: Don't you just love writing this sort of thing :)

2008-12-06 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Arnaud Delobelle wrote: * you seem to disregard the fact that in 'programming language' there is the word 'language'. A language is a way to _communicate_ information, in the case of a programming language you communicate it to the computer but

Re: Don't you just love writing this sort of thing :)

2008-12-06 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Arnaud Delobelle wrote: * you give the impression of being arrogant; Oddly enough, I wasn't the one who started by criticizing other people's code. I have no ego about my code; I gladly accept criticisms. But perhaps some other people are not so thick-skinned and

Re: Don't you just love writing this sort of thing :)

2008-12-06 Thread Stefan Behnel
Lawrence D'Oliveiro wrote: In message [EMAIL PROTECTED], Arnaud Delobelle wrote: * you seem to disregard the fact that in 'programming language' there is the word 'language'. A language is a way to _communicate_ information, in the case of a programming language you communicate

Re: Don't you just love writing this sort of thing :)

2008-12-05 Thread Duncan Booth
Lawrence D'Oliveiro [EMAIL PROTECTED] wrote: In message [EMAIL PROTECTED], Duncan Booth wrote: Have you ever considered trying to write readable code instead? (I must admit I haven't checked whether GZipFile works with the 'with' statement... That's why I prefer writing _correct_

Re: Don't you just love writing this sort of thing :)

2008-12-05 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Steven D'Aprano wrote: On Fri, 05 Dec 2008 13:27:35 +1300, Lawrence D'Oliveiro wrote: In message [EMAIL PROTECTED], Cong Ma wrote: The if ... != None is not necessary... if PatchDatePat.search(f) is OK. I don't do that. Perhaps you should? I prefer

Re: Don't you just love writing this sort of thing :)

2008-12-05 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Steven D'Aprano wrote: ... stupid formatting ... withallthedifferenttermsruntogetherintoonelinesoyoudon'tknowwhereoneendsandtheotherbeginsifthat'showyouliketowritecodefinethat'snothowIliketodoit -- http://mail.python.org/mailman/listinfo/python-list

Re: Don't you just love writing this sort of thing :)

2008-12-05 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Steven D'Aprano wrote: Since the context has been deleted, it's hard to tell whether the code as written by Lawrence ... If you want to reply to my message, reply to my message, don't reply to my reply to someone else's reply to my message. --

Re: Don't you just love writing this sort of thing :)

2008-12-05 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Duncan Booth wrote: ... but the mess you posted is going to be virtually untestable ... The mess I posted did actually work as written. ... whereas splitting it up into small testable functions will make it much easier for you to actually get somewhere near your

Re: Don't you just love writing this sort of thing :)

2008-12-05 Thread Steven D'Aprano
On Fri, 05 Dec 2008 23:28:48 +1300, Lawrence D'Oliveiro wrote: In message [EMAIL PROTECTED], Steven D'Aprano wrote: Since the context has been deleted, it's hard to tell whether the code as written by Lawrence ... If you want to reply to my message, reply to my message, don't reply to

Re: Don't you just love writing this sort of thing :)

2008-12-05 Thread Steven D'Aprano
On Fri, 05 Dec 2008 23:32:49 +1300, Lawrence D'Oliveiro wrote: In message [EMAIL PROTECTED], Duncan Booth wrote: ... but the mess you posted is going to be virtually untestable ... The mess I posted did actually work as written. ... whereas splitting it up into small testable functions

Re: Don't you just love writing this sort of thing :)

2008-12-05 Thread Steven D'Aprano
On Fri, 05 Dec 2008 23:16:08 +1300, Lawrence D'Oliveiro wrote: In message [EMAIL PROTECTED], Steven D'Aprano wrote: On Fri, 05 Dec 2008 13:27:35 +1300, Lawrence D'Oliveiro wrote: In message [EMAIL PROTECTED], Cong Ma wrote: The if ... != None is not necessary... if

Re: Don't you just love writing this sort of thing :)

2008-12-05 Thread Marco Mariani
Steven D'Aprano wrote: Gosh Lawrence, do tell, which category do YOU fall into? I suppose a mix-up between a cowbody (or Fonzie) coder and a troll. His programs have an inner poetry that we're obviously too stupid to understand. -- http://mail.python.org/mailman/listinfo/python-list

Re: Don't you just love writing this sort of thing :)

2008-12-05 Thread George Sakkis
On Dec 5, 8:06 am, Marco Mariani [EMAIL PROTECTED] wrote: Steven D'Aprano wrote: Gosh Lawrence, do tell, which category do YOU fall into? I suppose a mix-up between a cowbody (or Fonzie) coder and a troll. Naah.. more likely an (ex?) Lisper/Schemer. --

Re: Don't you just love writing this sort of thing :)

2008-12-05 Thread Aaron Brady
On Dec 5, 4:32 am, Lawrence D'Oliveiro [EMAIL PROTECTED] central.gen.new_zealand wrote: The code people write is probably a direct reflection of their thinking processes: For example, slow, plodding, one step at a time, incapable of imaginative leaps, versus those who operate directly on larger

Re: Don't you just love writing this sort of thing :)

2008-12-05 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Aaron Brady wrote: On Dec 5, 4:32 am, Lawrence D'Oliveiro [EMAIL PROTECTED] central.gen.new_zealand wrote: The code people write is probably a direct reflection of their thinking processes: For example, slow, plodding, one step at a time, incapable of

Re: Don't you just love writing this sort of thing :)

2008-12-05 Thread Istvan Albert
On Dec 3, 8:07 pm, Lawrence D'Oliveiro [EMAIL PROTECTED] central.gen.new_zealand wrote: snip code Originally, like many others here I said YIKES! but on a second read, it is not that bad. It actually grows on you. After looking at it one more time I found it neat, very concise without being

Re: Don't you just love writing this sort of thing :)

2008-12-05 Thread Steven D'Aprano
On Fri, 05 Dec 2008 20:19:22 -0800, Istvan Albert wrote: On Dec 3, 8:07 pm, Lawrence D'Oliveiro [EMAIL PROTECTED] central.gen.new_zealand wrote: snip code Originally, like many others here I said YIKES! but on a second read, it is not that bad. It actually grows on you. Just like a

Re: Don't you just love writing this sort of thing :)

2008-12-05 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Steven D'Aprano wrote: On Fri, 05 Dec 2008 23:28:48 +1300, Lawrence D'Oliveiro wrote: In message [EMAIL PROTECTED], Steven D'Aprano wrote: Since the context has been deleted, it's hard to tell whether the code as written by Lawrence ... If you want to

Re: Don't you just love writing this sort of thing :)

2008-12-05 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Steven D'Aprano wrote: It would have been far more concise ... Gee, I thought people were complaining it was too cryptic, now it turns out they were actually complaining because it was too verbose. -- http://mail.python.org/mailman/listinfo/python-list

Re: Don't you just love writing this sort of thing :)

2008-12-05 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Istvan Albert wrote: Originally, like many others here I said YIKES! but on a second read, it is not that bad. It actually grows on you. After looking at it one more time I found it neat, very concise without being unreadable. The key thing is, it's

Re: Don't you just love writing this sort of thing :)

2008-12-04 Thread Duncan Booth
Lawrence D'Oliveiro [EMAIL PROTECTED] wrote: for \ Entry \ in \ sorted \ ( f for f in os.listdir(PatchesDir) if PatchDatePat.search(f) != None ) \ : Patch = (open,

Re: Don't you just love writing this sort of thing :)

2008-12-04 Thread Cong Ma
Lawrence D'Oliveiro wrote: for \ Entry \ in \ sorted \ ( f for f in os.listdir(PatchesDir) if PatchDatePat.search(f) != None ) \ : Patch = (open, gzip.GzipFile)[Entry.endswith(.gz)](os.path.join(PatchesDir, Entry), r) ...

Re: Don't you just love writing this sort of thing :)

2008-12-04 Thread Harold Fellermann
On Dec 4, 10:39 am, Cong Ma [EMAIL PROTECTED] wrote: Lawrence D'Oliveiro wrote: for \         Entry \     in \         sorted \           (             f for f in os.listdir(PatchesDir) if PatchDatePat.search(f) != None           ) \ :     Patch = (open,

Re: Don't you just love writing this sort of thing :)

2008-12-04 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Duncan Booth wrote: Have you ever considered trying to write readable code instead? (I must admit I haven't checked whether GZipFile works with the 'with' statement... That's why I prefer writing _correct_ code instead. --

Re: Don't you just love writing this sort of thing :)

2008-12-04 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Cong Ma wrote: The if ... != None is not necessary... if PatchDatePat.search(f) is OK. I don't do that. -- http://mail.python.org/mailman/listinfo/python-list

Re: Don't you just love writing this sort of thing :)

2008-12-04 Thread Steven D'Aprano
On Fri, 05 Dec 2008 13:27:35 +1300, Lawrence D'Oliveiro wrote: In message [EMAIL PROTECTED], Cong Ma wrote: The if ... != None is not necessary... if PatchDatePat.search(f) is OK. I don't do that. Perhaps you should? Since the context has been deleted, it's hard to tell whether the

Don't you just love writing this sort of thing :)

2008-12-03 Thread Lawrence D'Oliveiro
for \ Entry \ in \ sorted \ ( f for f in os.listdir(PatchesDir) if PatchDatePat.search(f) != None ) \ : Patch = (open, gzip.GzipFile)[Entry.endswith(.gz)](os.path.join(PatchesDir, Entry), r) ... read from Patch ... Patch.close() #end

Re: Don't you just love writing this sort of thing :)

2008-12-03 Thread James Mills
uggh no! On Thu, Dec 4, 2008 at 11:07 AM, Lawrence D'Oliveiro [EMAIL PROTECTED] wrote: for \ Entry \ in \ sorted \ ( f for f in os.listdir(PatchesDir) if PatchDatePat.search(f) != None ) \ : Patch = (open,