I like python for 'whittling' code until I get the effect I want. I also like 
the fact that it forces keep me from making my code too unreadable by others. I 
was always getting in over my head with that when it came to coding in Perl. 
Some of my old Perl code I still have trouble reading, even though I wrote it. 
:/

Albert L. Perrien II
Database Coordinator
Office: 360-598-1339

From: [email protected] 
[mailto:[email protected]] On Behalf Of Kevin LaTona
Sent: Thursday, July 18, 2013 4:41 PM
To: Seattle Python Interest Group
Subject: Re: [SEAPY] Collection of Advanced Idioms (was: Training)


So another "idiom": code review!


Or what about

with open('mlccal.dat', 'r') as f:
    content = f.readlines()


>> From The Zen of Python
>> Beautiful is better than ugly.

Agreed  "with" is not ugly, not sure I would call it Beautiful..... maybe.




>>Explicit is better than implicit.

Not sure "with" really is telling me that it will close out the FD when 
leaving....... but Zen rules can be broken some days.




>>Simple is better than complex.

But it sure is simpler than the classic mode of opening and closing a document.




So on a scale of 10,  I would give "with" a solid 7.


-Kevin

______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________

Reply via email to