On 8/11/06, "Martin v. Löwis" <martin at v.loewis.de> wrote: > Michael Chermside schrieb: > > I propose that we institute a new policy. The policy should state: > > > > __eq__ methods should always return True or False. They should > > only raise an exception if there is some internal error within > > one of the objects being compared -- they should never raise > > an exception because the other object is of an unexpected type. > > That policy is currently difficult to implement, but reasonable > (difficult because it is quite some code to write). Why? Are you thinking of the standard library, or of an end user's __eq__ method? Returning False from your __eq__ if other's type is unexpected doesn't seem a lot of code. Or am I misunderstanding something? -- --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4