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

Ethan Furman ethan at stoneleaf.us
Wed Dec 10 00:43:10 CET 2008


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 Patch ...
>     Patch.close()
> #end for

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 mark in Python's favor that such self-expression is possible, 
and functional.

Yes, Lawrence, I do love writing fun code.

~ethan~



More information about the Python-list mailing list