Closed squirrel532 closed 3 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.
sorted()
list.sort()
cmp
functools.cmp_to_key
key
See https://docs.python.org/3.8/library/stdtypes.html#list.sort
Also, can you add an entry and short description to the fixers documentation?
Thank you!
In python3,
sorted()
andlist.sort()
only accept keyword-only arguments and drop support of the flagcmp
. This fixer helps user overcome all these traps by wrappingfunctools.cmp_to_key
to originalcmp
argument and transforming it to akey
argument.See https://docs.python.org/3.8/library/stdtypes.html#list.sort