"George Sakkis" <[EMAIL PROTECTED]> wrote:
> As I wrote in my last reply to Nick though, I question Python's right to
> perform
> such limited forms of design-by-contract-like assertions ("why not add
> a precondition
> on __add__(self,other) to enforce isinstance(other, self.__class__)
> ?") when it refuses to formalize interfaces for sequences, iterators
> et al.
Because 5, 5+0j, 5.0 are different types. To not be able to add any of
them because they are different types, would be silly. Note that
Decimal is a different beast, which is why I don't include it. There's
also string + unicode (at least in 2.x), and if some sort of
unicode view makes it into 3.x, view + unicode.
- Josiah
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com