Message132453
| Author |
eltoder |
| Recipients |
Trundle, alex, benjamin.peterson, brett.cannon, daniel.urban, dmalcolm, eltoder, georg.brandl, mark.dickinson, nadeem.vawda, ncoghlan, pitrou, rhettinger, santoso.wijaya, terry.reedy |
| Date |
2011年03月29日.01:31:38 |
| SpamBayes Score |
3.4886816e-11 |
| Marked as misclassified |
No |
| Message-id |
<1301362300.53.0.130995306652.issue11549@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
If we have to preserve backward compatibility of Python AST API, we can do this relatively easily (at the expense of some code complexity):
* Add 'version' argument to compile() and ast.parse() with default value of 1 (old AST). Value 2 will correspond to the new AST.
* Do not remove Num/Str/Bytes/Ellipsis Python classes. Make PyAST_obj2mod and PyAST_mod2obj do appropriate conversions when version is 1.
* Possibly emit a PendingDeprecationWarning when version 1 is used with the goal of removing it in 3.5
Alternative implementation is to leave Num/Str/etc classes in C as well, and write visitors (similar to folding one) to convert AST between old and new forms.
Does this sounds reasonable? Should this be posted to python-dev? Should I write a PEP (I'd need some help with this)?
Are there any other big issues preventing this to be merged? |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年03月29日 01:31:40 | eltoder | set | recipients:
+ eltoder, brett.cannon, georg.brandl, rhettinger, terry.reedy, mark.dickinson, ncoghlan, pitrou, nadeem.vawda, benjamin.peterson, alex, Trundle, dmalcolm, daniel.urban, santoso.wijaya |
| 2011年03月29日 01:31:40 | eltoder | set | messageid: <1301362300.53.0.130995306652.issue11549@psf.upfronthosting.co.za> |
| 2011年03月29日 01:31:38 | eltoder | link | issue11549 messages |
| 2011年03月29日 01:31:38 | eltoder | create |
|