Skip to content

Commit 42f3188

Browse files
committed
[Python] Remove deprecated TObject __eq__ pythonization
It was deprecated and scheduled for removal in 70e67f1.
1 parent 5208986 commit 42f3188

File tree

6 files changed

+2
-112
lines changed

6 files changed

+2
-112
lines changed

README/ReleaseNotes/v640/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ The following people have contributed to this new version:
3434
## Deprecation and Removal
3535
* The `TH1K` class was removed. `TMath::KNNDensity` can be used in its stead.
3636

37+
* The `TObject` equality operator pythonization (`TObject.__eq__`) that was deprecated in ROOT 6.38 and scheduled for removal in ROOT 6.40 is removed
38+
3739
## Build System
3840

3941
## Core Libraries

bindings/pyroot/pythonizations/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ set(cpp_sources
134134
src/RPyROOTApplication.cxx
135135
src/GenericPyz.cxx
136136
src/TClassPyz.cxx
137-
src/TObjectPyz.cxx
138137
src/TTreePyz.cxx
139138
src/CPPInstancePyz.cxx
140139
src/TPyDispatcher.cxx

bindings/pyroot/pythonizations/python/ROOT/_pythonization/_tobject.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
# For the list of contributors see $ROOTSYS/README/CREDITS. #
99
################################################################################
1010

11-
from ROOT.libROOTPythonizations import AddTObjectEqNePyz
1211
import cppyy
1312

1413
# Searching
@@ -27,22 +26,6 @@ def _contains(self, o):
2726
# Comparison operators
2827

2928

30-
def _eq(self, o):
31-
import warnings
32-
33-
warnings.warn(
34-
"\nTObject.__eq__ is deprecated and will be removed in ROOT 6.40."
35-
"\n\nIt forwards to TObject::Equals(), which uses pointer comparison if"
36-
" not overridden in derived classes."
37-
"\nThis may be confusing, because people expect value comparisons."
38-
"\nUse Pythons `is` for pointer comparison, or request/implement"
39-
" `operator==` on the C++ side if you need value-based equality checks.",
40-
FutureWarning,
41-
stacklevel=2,
42-
)
43-
return self._cpp_eq(o)
44-
45-
4629
def _lt(self, o):
4730
if isinstance(o, cppyy.gbl.TObject):
4831
return self.Compare(o) == -1
@@ -78,9 +61,6 @@ def pythonize_tobject():
7861
klass.__contains__ = _contains
7962

8063
# Inject comparison operators
81-
AddTObjectEqNePyz(klass)
82-
klass._cpp_eq = klass.__eq__
83-
klass.__eq__ = _eq
8464
klass.__lt__ = _lt
8565
klass.__le__ = _le
8666
klass.__gt__ = _gt

bindings/pyroot/pythonizations/src/PyROOTModule.cxx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,6 @@ static PyMethodDef gPyROOTMethods[] = {
132132
(char *)"Allow to access branches as tree attributes"},
133133
{(char *)"AddTClassDynamicCastPyz", (PyCFunction)PyROOT::AddTClassDynamicCastPyz, METH_VARARGS,
134134
(char *)"Cast the void* returned by TClass::DynamicCast to the right type"},
135-
{(char *)"AddTObjectEqNePyz", (PyCFunction)PyROOT::AddTObjectEqNePyz, METH_VARARGS,
136-
(char *)"Add equality and inequality comparison operators to TObject"},
137135
{(char *)"BranchPyz", (PyCFunction)PyROOT::BranchPyz, METH_VARARGS,
138136
(char *)"Fully enable the use of TTree::Branch from Python"},
139137
{(char *)"AddPrettyPrintingPyz", (PyCFunction)PyROOT::AddPrettyPrintingPyz, METH_VARARGS,

bindings/pyroot/pythonizations/src/PyROOTPythonize.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ PyObject *BranchPyz(PyObject *self, PyObject *args);
2525

2626
PyObject *AddTClassDynamicCastPyz(PyObject *self, PyObject *args);
2727

28-
PyObject *AddTObjectEqNePyz(PyObject *self, PyObject *args);
29-
3028
PyObject *CPPInstanceExpand(PyObject *self, PyObject *args);
3129

3230
} // namespace PyROOT

bindings/pyroot/pythonizations/src/TObjectPyz.cxx

Lines changed: 0 additions & 87 deletions
This file was deleted.

0 commit comments

Comments
 (0)