On Feb 11, 2008 10:40 PM, Neil Toronto <[EMAIL PROTECTED]> wrote:
> The problem is that, like all the binary operators, "orderable" is only
> defined for pairs of types. A single declaration of orderable-ness
> necessarily lacks information needed for type safety.

Actually, lots of languages have ways to express that the values of a
given type are orderable. E.g. in C++ you can create a template that
takes a single type argument which must define a total ordering using
'<'.

> Besides probably not being "worth it" (as you say), forcing the classes
> into an inheritance hierarchy doesn't seem Pythonic. (I may not have the
> Python-fu to make such declarations, but I'll call 'em as I see 'em.)

You're forgetting about virtual inheritance.

> Also, x objects and y objects may be orderable homogeneously, but not
> heterogeneously. I could impose a total order on sets of circles and
> another on sets of squares without imposing an order on sets of both
> circles and squares, and not be able to spell this under the inheritance
> approach.

Yes, that was what I explained at length.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
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

Reply via email to