Repository: thrift Updated Branches: refs/heads/master 8551f3f53 -> 341390c19
THRIFT-3388 hash doesn't work on set/list Client: Python Patch: Jens Geyer This essentially reverts commit 790a3881b2bd8d0e0f868e9f28205ea60cfb0f2d from THRIFT-2621 Project: http://git-wip-us.apache.org/repos/asf/thrift/repo Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/341390c1 Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/341390c1 Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/341390c1 Branch: refs/heads/master Commit: 341390c19a4f559ddf9f64e5189ec103890ed239 Parents: 8551f3f Author: Jens Geyer <[email protected]> Authored: Tue Nov 17 22:14:40 2015 +0100 Committer: Jens Geyer <[email protected]> Committed: Tue Nov 17 22:14:40 2015 +0100 ---------------------------------------------------------------------- compiler/cpp/src/generate/t_py_generator.cc | 10 ---------- 1 file changed, 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/thrift/blob/341390c1/compiler/cpp/src/generate/t_py_generator.cc ---------------------------------------------------------------------- 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 @@ void t_py_generator::generate_py_struct_definition(ofstream& out, << 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
