I'm attempting to convert a library from Py 2.7.x to Py 3.7.x using 2to3 on Win10. Following reference from here.
I've seen that to convert some parts of Python you need to explicitly add Fixers, specifically:
idioms
This optional fixer performs several transformations that make Python code more idiomatic. Type comparisons like type(x) is SomeClass and type(x) == SomeClass are converted to isinstance(x, SomeClass). while 1 becomes while True. This fixer also tries to make use of sorted() in appropriate places. For example, this block
L = list(some_iterable) L.sort() is changed to
L = sorted(some_iterable)
So I add it to my commandline:
2to3 --output-dir=C:\my\py3\module -f all -f buffer -f idioms -f set_literal -f ws_comma -W -n C:\my\py2\module
2to3 will generate the correct files in the C:\my\py3\module folder but list.sort() has not been resolved to sorted(list)
What am I missing here?