[Python-ideas] Making it easy to prepare for PEP479

Terry Reedy tjreedy at udel.edu
Mon May 18 17:24:06 CEST 2015


On 5/18/2015 10:52 AM, Steven D'Aprano wrote:
> On Mon, May 18, 2015 at 10:17:06AM -0400, Terry Reedy wrote:
>
>> Try the following: add the future statement to the top of modules with
>> generators, compile with 3.5, and when successful, comment-out the
>> statement.  For continued testing, especially with multiple authors,
>> write functions to un-comment and re-comment a file.  In the test file:
>>
>> if <3.5>: uncomment('xyz')  # triggers re-compile on import
>> import xyz
>> if <3.5>: recomment('xyz')  # ditto,
>>
>> If this works, put pep479_helper on pypi.

> I'm not entirely sure what you are trying to do,

Solve the OP's problem.  What are *you* trying to do?  If you do not 
think that the offered solution will work, please explain why, instead 
of diverting attention to some insane projection of yours.

 > but I *think* what you
> are trying is to have the byte code in the .pyc file be different from
> what the source code in the .py file says.

Do you really think I meant the opposite of what I said?
Standard Python behavior that you are completely familiar with: edit 
x.py and import it; Python assumes that x.pyc is obsolete, recompiles 
x.py and rewrites x.pyc.

-- 
Terry Jan Reedy



More information about the Python-ideas mailing list