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