[issue19249] Enumeration.__eq__

2013-11-13 Thread Ethan Furman
Ethan Furman added the comment: changeset ca909a3728d3 -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker ___ __

[issue19249] Enumeration.__eq__

2013-11-10 Thread Ethan Furman
Ethan Furman added the comment: Done and done. -- stage: test needed -> patch review Added file: http://bugs.python.org/file32572/issue19249.stoneleaf.02.patch ___ Python tracker ___

[issue19249] Enumeration.__eq__

2013-11-10 Thread Nick Coghlan
Nick Coghlan added the comment: Since the default eq implementation handles ducktyping correctly, dropping the Enum specific __eq__ implementation should be fine. Just make sure this still works: >>> class AlwaysEqual: ... def __eq__(self, other): ... return True ... >>> from enum

[issue19249] Enumeration.__eq__

2013-11-08 Thread Ethan Furman
Ethan Furman added the comment: Given that __eq__ isn't adding anything, I think removing it is a fine option. -- keywords: +patch Added file: http://bugs.python.org/file32548/issue19249.stoneleaf.01.patch ___ Python tracker

[issue19249] Enumeration.__eq__

2013-10-19 Thread Ethan Furman
Ethan Furman added the comment: Given the rarity of singletons, I don't think changing pickle in that way is appropriate. Besides, pickle protocol 2 and above don't have the problem. -- ___ Python tracker ___

[issue19249] Enumeration.__eq__

2013-10-19 Thread CliffM
CliffM added the comment: It is appropriate to modify the pickle-module to trap (a potential) the singletonicity-breaking event and raise a warning ? (I'm guessing an exception would be far too rude) I like the idea of using identity-equality, but without the above trap one might get really w

[issue19249] Enumeration.__eq__

2013-10-13 Thread Ethan Furman
Ethan Furman added the comment: Here's the current __eq__ method: def __eq__(self, other): if type(other) is self.__class__: return self is other return NotImplemented It is, in fact, using identity and not value equality. I'm thinking we should either remove an

[issue19249] Enumeration.__eq__

2013-10-13 Thread CliffM
New submission from CliffM: Given that enumeration members are Singletons, can we not rely on the default __eq__() method ? (FWIW the existing tests all pass if you delete it) This might be confusing for a reader later, so needs documenting. Although I think it should be documented (in enum.p