[Python-3000] please keep open() as a builtin, and general concerns about Py3k complexity (original) (raw)

Georg Brandl g.brandl at gmx.net
Wed May 23 08:21:10 CEST 2007


Steve Howell schrieb:

--- Guillaume Proux <gproux+py3000 at gmail.com> wrote:

On 5/23/07, Steve Howell <showell30 at yahoo.com> wrote: > 17.7% of the files I searched have calls to open().

My understand is that the mythical "python 2.x -> 3.0" tool will automatically migrate your code by using the AST to find all references to "open" and when finding one, add the correct import and replace the open by the io.open call Agreed, but my concern isn't the conversion itself. I just want open() to stay as a builtin. In simple throwaway programs I appreciate the convenience, and in larger programs I appreciate not having to context-switch from the problem at hand to put an "import" at the top.

ISTM that many modules using open() do also use os.path utilities to create the filename given to open(). In that case, you have an import statement in any case.

Georg



More information about the Python-3000 mailing list