Status: New Owner: ken...@google.com Labels: Type-Defect Priority-Medium
New issue 189 by voberoi: Generated message __cmp__() in Python should consistently order generated messages
http://code.google.com/p/protobuf/issues/detail?id=189 What steps will reproduce the problem? 1. Generate protobuf code in Python for a message that contains a repeated field. 2. Deserialize two of these messages in Python, making sure that the repeated field contains the same items. 3. Say the field is "foo". sorted(msg1.foo) == sorted(msg2.foo) returns False (not sure if this is consistent as I'm unsure about what comparator sorted() is using here since I never saw a __cmp__ in google.protobuf.internal.contains.[BaseContainer|Repeated*FieldContainer]) What is the expected output? What do you see instead? sorted(msg1.foo) == sorted(msg2.foo) should return True in Python if foo is a repeated field that contains the same items in msg1 What version of the product are you using? On what operating system? protobuf 2.3, python 2.6, ubuntu lucid lynx Please provide any additional information below. It seems like the default behavior should attempt to generate a consistent ordering, maybe by taking an arbitrary scalar field in a message and comparing that field. -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to proto...@googlegroups.com. To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.