Author anthonybaxter
Recipients
Date 2007-01-29.12:37:14
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Attached version 3 of the patch.

I've added an '#if 0'd warning in ast.c - for instance, when enabled, you get
./setup.py:1336: SyntaxWarning: print no longer a statement in Py3.0
I'll make a new version of a -W py3k patch that enables this as well. 

I've made the other cleanup suggested by twouters. I'm not clear on the best way to do the tests for this - the from __future__ needs to be at the start of the file. My concern is that anything that tries to compile the whole test file with this under a previous version will choke and die on the print-as-function. Not sure if this is a hugely bad problem or not. 

Docs will follow once I bother wrapping my head around LaTeX and figuring out the best way to do the docs. I'm guessing we need a note in ref/ref6.tex in the section on the print statement, another bit in the same file in the subsection on Future statements, and something in lib/libbltin.tex. Did I miss anywhere?

In current 3.0, the builtin is called Print, not print. Is there a reason for this? Is it just a matter of updating all the tests and ripping out the support for the print statement and the related opcodes? If so, I'll tackle that next. Doing this does mean that the docs and the stdlib and the tests will all need a huge amount of updating, and it will make merging from the trunk to the p3yk branch much more painful.

While I'm in the vague area - why is PRINT_ITEM inlined in ceval.c? Couldn't it be punted out to a separate function, making the main switch statement just that little bit smaller? I can't imagine that making 'print' that little tiny bit faster is actually worthwhile, compared to shrinking the main switch statement.

except E as V, I'll look at later for a different patch. My tree is already getting quite cluttered already with uncommitted patches :-)
File Added: print_function.patch3
History
Date User Action Args
2007-08-23 15:56:13adminlinkissue1633807 messages
2007-08-23 15:56:13admincreate