-
Notifications
You must be signed in to change notification settings - Fork 295
Open
Labels
Description
I'm hoping to actually use pasteurize to maintain a py2 branch of a py3 codebase, langcodes.
Right now I change all the py3 syntax to py2 syntax manually in a branch of unmerged git commits, which is a pain. It would be great if pasteurize could automate this.
One issue I've run into: pasteurize doesn't know what to do with the "yield from" syntax. When it appears as a statement on its own, it can be translated straightforwardly, if a bit inefficiently. For example, the syntax
yield from parse_item(lines)can become:
for _item in parse_item(lines):
yield _itemIt would probably be much harder to translate the expression form, result = yield from parse_item(lines). I can't think of a good way. PEP 380 has a 39-line monstrosity as the translation.