THRIFT-3388 hash doesn't work on set/list
Client: Python
Patch: Jens Geyer
This essentially reverts commit 790a3881b2bd8d0e0f868e9f28205ea60cfb0f2d from THRIFT-2621
diff --git a/compiler/cpp/src/generate/t_py_generator.cc b/compiler/cpp/src/generate/t_py_generator.cc
index 31936b7..44816ab 100644
--- a/compiler/cpp/src/generate/t_py_generator.cc
+++ b/compiler/cpp/src/generate/t_py_generator.cc
@@ -753,16 +753,6 @@
<< endl;
}
- out << indent() << "def __hash__(self):" << endl;
- indent_up();
- indent(out) << "value = 17" << endl; // PYTHONHASHSEED would be better, but requires Python 3.2.3
- for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
- indent(out) << "value = (value * 31) ^ hash(self." << (*m_iter)->get_name() + ")" << endl;
- }
- indent(out) << "return value" << endl;
- indent_down();
- out << endl;
-
if (!gen_slots_) {
// Printing utilities so that on the command line thrift
// structs look pretty like dictionaries