Skip to content

Conversation

@strmfos
Copy link
Contributor

@strmfos strmfos commented Sep 25, 2025

Replace deprecated cmp parameter in sorted() calls with key=cmp_to_key() to fix Python 3 compatibility. The cmp parameter was removed in Python 3.0.

  • Use functools.cmp_to_key() as the official migration path
  • Maintains identical sorting behavior across Python versions
  • Fixes: TypeError: 'cmp' is an invalid keyword argument for sorted()

Copy link
Member

@jonatack jonatack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @strmfos for your proposal. However, it is a duplicate of #1943 that goes further (don't hesitate to review it!), so closing here for now.

@jonatack jonatack closed this Sep 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants