Bryan Olson <[EMAIL PROTECTED]> writes: > And herein is the problem: A class may implement "__add__" any > way the programmer chooses. Python should require, or at least > document requirements, on further properties of addition. Python > should insist that addition be symmetric an transitive, and > classes implementing addition provide an additive identity.
Are you saying "abc"+"def" should not be concatenation? I guess that's reasonable. As long as + is string concatenation though, the principle of least astonishment suggests that "sum" should conconcatenate several strings. I'm not sure what you mean by addition being symmetric or transitive; it is not an equivalence relation. Do you mean commutative and associative? I'm not sure if floating-point arithmetic has those properties, strictly speaking. -- http://mail.python.org/mailman/listinfo/python-list