Why no open(f, "w").write()?

John La Rooy larooy at xtar.co.nz
Mon Jun 3 02:13:32 EDT 2002


> 
> It is explicitly not a documented part of the interface - the documented
> part is that it is not safe to rely on this behaviour.
> 
> When it is explicitly documented that this behaviour is guaranteed now and
> forever, for all implementations of Python after a specified version, I will
> *consider* using this behaviour. Until then it is not worthy of
> consideration.
> 
> Tim Delaney
> 
> 

It's unlikely to be explicitly documented. from the docs...

The file() constructor is new in Python 2.2. The previous spelling, open(),
is retained for compatibility, and is an alias for file().

So you shouldn't be using open() in new programs anyway

John



More information about the Python-list mailing list