Skip to content

[Feature]: Modernize BaseESPUser comparison methods to Python 3 #5701

@hamsa-09

Description

@hamsa-09

Problem Statement

The BaseESPUser class relies on Python 2's deprecated cmp method and redundant manual comparison overrides to sort user objects. This creates unnecessary technical debt and uses sorting logic that is not natively supported or optimized in
modern Python 3

Proposed Solution

  • Adding the @functools.total_ordering decorator to the class.
  • Replacing cmp with explicit eq and lt methods that cleanly handle comparisons (including AnonymousESPUser hierarchies) using native tuple comparison.
  • Removing the deprecated cmp method and the redundant manual boilerplate overrides for gt, ge, le, and ne.

Alternatives Considered

No response

Additional Context

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions