Hi,
I've been told, that following code snippet is not good.
open(myfile,w).write(astring) , because I'm neither explicitely
closing nor using the new 'with' syntax.
What exactly is the impact of not closing the file explicitely
(implicitley with a 'with' block)?
Even with my example
I'd
On Tue, Apr 13, 2010 at 3:01 PM, gelonida gelon...@gmail.com wrote:
Hi,
I've been told, that following code snippet is not good.
open(myfile,w).write(astring) , because I'm neither explicitely
closing nor using the new 'with' syntax.
What exactly is the impact of not closing the file
On Tue, 13 Apr 2010 15:01:25 -0700, gelonida wrote:
Hi,
I've been told, that following code snippet is not good.
open(myfile,w).write(astring) , because I'm neither explicitely
closing nor using the new 'with' syntax.
What exactly is the impact of not closing the file explicitely
What about open('foo', 'w').close().
Does it have the same problems?
--- Giampaolo
http://code.google.com/p/pyftpdlib
http://code.google.com/p/psutil
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, Apr 13, 2010 at 5:45 PM, Giampaolo Rodola' gne...@gmail.com wrote:
What about open('foo', 'w').close().
Does it have the same problems?
Well, no, but that's only because it's a pointless no-op that doesn't
really do anything besides possibly throwing an exception (e.g. if the
script
gelonida wrote:
Hi,
I've been told, that following code snippet is not good.
open(myfile,w).write(astring) , because I'm neither explicitely
closing nor using the new 'with' syntax.
What exactly is the impact of not closing the file explicitely
(implicitley with a 'with' block)?
Even with
On Tue, 2010-04-13 at 18:19 -0700, Chris Rebert wrote:
On Tue, Apr 13, 2010 at 5:45 PM, Giampaolo Rodola' gne...@gmail.com wrote:
What about open('foo', 'w').close().
Does it have the same problems?
Well, no, but that's only because it's a pointless no-op that doesn't
really do anything