Skip to content

[Python] Remove TObject __eq__ pythonization #19145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

guitargeek
Copy link
Contributor

The TObject __eq__ pythonization calls TObject::Equals(), which by default does a pointer comparison. That can be very confusing for Python users.

The TObject `__eq__` pythonization calls `TObject::Equals()`, which by
default does a pointer comparison. That can be very confusing for Python
users.
@vepadulano
Copy link
Member

Just a fly-by thought, this pythonization has been around for so many years that, while I still strongly believe its current implementation is buggy, I am afraid this will introduce a backwards-incompatible behaviour far, far worse than #19061. One possible way to mitigate this is to have a check that if there is no operator == implementation (or equivalent) for a class, then we can raise an informative exception. Actually, we should probably just raise a warning and declare a deprecation phase for this. Also, note that while the discussion at #19061 is regarding TH1 classes and derived only, this PR is going to have effects for every TObject derived class.

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