Ian Bicking wrote: > BJörn Lindqvist wrote: >> * Functions for reading and writing a whole file - better handled >> by file objects read() and write() methods. > > I would be disappointed to see this left out, because I get really tired > of this little dance: > > f = open(filename) > c = f.read() > f.close() > return c Python 2.5 (well, once someone finds time to update mwh's patch): with open(filename) as f: return f.read() Behaviour guaranteed by language definition ;) Cheers, Nick. P.S. I too would really like to see this happen for 2.5. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia --------------------------------------------------------------- http://www.boredomandlaziness.org
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4