(original) (raw)
So is exec(tokenize.open(file).read()) the actual replacement for execfile()? Not too bad, but still not obvious (or widely promoted - I'd never heard of it).
Top-posted from my Windows Phone
Top-posted from my Windows Phone
From: Nick Coghlan
Sent: �6/�14/�2014 18:31
To: Steve Dower
Cc: Greg Ewing; python-dev@python.org
Subject: Re: \[Python-Dev\] Criticism of execfile() removal in Python3
On 15 Jun 2014 09:37, "Steve Dower" <Steve.Dower@microsoft.com> wrote:
\>
\> I think the point is that the encoding may be embedded in the file as a coding comment and there's no obvious way to deal with that.
Opening source files correctly is the intended use case for tokenize.open().
Cheers,
Nick.