Skip to content

PLR0124 Documentation Issue #22160

@bruno-brant

Description

@bruno-brant

Summary

PLR0124 documentation states:

Comparing a name to itself always results in the same value (...)

Bu it doesn't, as one can overload __eq__.

This came up in a situation where I had an assertion like:

assert foo == foo

I wrote the test because foo's class had overriden eq and I needed to test that the equality still held.

I suggest to rewrite the first sentence, switching "always" to "likely" and adjusting the rest accordingly:

Comparing a name to itself likely results in a truthy value, and is probably a mistake.

Version

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions