amyreese / fissix

backport of lib2to3, with enhancements
Other
46 stars 24 forks source link

Rename function arg async to async_ #15

Open jayvdb opened 4 years ago

jayvdb commented 4 years ago

A lot of pre py37 codebases use async which needs to be renamed on Python 3.7+. Detecting when it was used before it was claimed by the language may be a bit tricky to perfect, but the most common case of function args seems quite doable.

graingert commented 4 years ago

kwargs can be passed in with

foo.task1(**{"async": True})
foo.task2(**{"await": True})

the other way is harder,

maybe a decorator could be provided to alias keyword kwargs into _ suffix alternatives?

@pep492
def task1(ham, async_):

@pep492
def task2(ham, await_):