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,

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: 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).