On 8/11/06, "Martin v. Löwis" <[EMAIL PROTECTED]> 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/) _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com