amyreese / fissix

backport of lib2to3, with enhancements
Other
45 stars 22 forks source link

add fixer for `sorted()` and `list.sort` #25

Closed squirrel532 closed 3 years ago

squirrel532 commented 4 years ago

In python3, sorted() and list.sort() only accept keyword-only arguments and drop support of the flag cmp. This fixer helps user overcome all these traps by wrapping functools.cmp_to_key to original cmp argument and transforming it to a key argument.

See https://docs.python.org/3.8/library/stdtypes.html#list.sort

amyreese commented 4 years ago

Also, can you add an entry and short description to the fixers documentation?

amyreese commented 3 years ago

Thank you!