Mercurial > cpython-lru_cache-weakref
comparison Python/pythonrun.c @ 45891:727f743cf630 legacy-trunk
Backport of the print function, using a __future__ import.
This work is substantially Anthony Baxter's, from issue
1633807. I just freshened it, made a few minor tweaks,
and added the test cases. I also created issue 2412,
which is to check for 2to3's behavior with the print
function. I also added myself to ACKS.
| author | Eric Smith <eric@trueblade.com> |
|---|---|
| date | Tue, 18 Mar 2008 23:45:49 +0000 |
| parents | 2efcd7f606f8 |
| children | 5341b30b1812 |
comparison
equal
deleted
inserted
replaced
| 45890:96bd9722e31d | 45891:727f743cf630 |
|---|---|
| 736 return -1; | 736 return -1; |
| 737 */ | 737 */ |
| 738 } | 738 } |
| 739 } | 739 } |
| 740 | 740 |
| 741 #if 0 | |
| 741 /* compute parser flags based on compiler flags */ | 742 /* compute parser flags based on compiler flags */ |
| 742 #define PARSER_FLAGS(flags) \ | 743 #define PARSER_FLAGS(flags) \ |
| 743 ((flags) ? ((((flags)->cf_flags & PyCF_DONT_IMPLY_DEDENT) ? \ | 744 ((flags) ? ((((flags)->cf_flags & PyCF_DONT_IMPLY_DEDENT) ? \ |
| 744 PyPARSE_DONT_IMPLY_DEDENT : 0)) : 0) | 745 PyPARSE_DONT_IMPLY_DEDENT : 0)) : 0) |
| 745 | 746 #endif |
| 746 #if 0 | 747 #if 1 |
| 747 /* Keep an example of flags with future keyword support. */ | 748 /* Keep an example of flags with future keyword support. */ |
| 748 #define PARSER_FLAGS(flags) \ | 749 #define PARSER_FLAGS(flags) \ |
| 749 ((flags) ? ((((flags)->cf_flags & PyCF_DONT_IMPLY_DEDENT) ? \ | 750 ((flags) ? ((((flags)->cf_flags & PyCF_DONT_IMPLY_DEDENT) ? \ |
| 750 PyPARSE_DONT_IMPLY_DEDENT : 0) \ | 751 PyPARSE_DONT_IMPLY_DEDENT : 0) \ |
| 751 | ((flags)->cf_flags & CO_FUTURE_WITH_STATEMENT ? \ | 752 | ((flags)->cf_flags & CO_FUTURE_PRINT_FUNCTION ? \ |
| 752 PyPARSE_WITH_IS_KEYWORD : 0)) : 0) | 753 PyPARSE_PRINT_IS_FUNCTION : 0)) : 0) |
| 753 #endif | 754 #endif |
| 754 | 755 |
| 755 int | 756 int |
| 756 PyRun_InteractiveOneFlags(FILE *fp, const char *filename, PyCompilerFlags *flags) | 757 PyRun_InteractiveOneFlags(FILE *fp, const char *filename, PyCompilerFlags *flags) |
| 757 { | 758 { |
