[Python-Dev] Re: PEP 326 now online (original) (raw)
Guido van Rossum guido at python.org
Tue Jan 6 14:45:42 EST 2004
- Previous message: [Python-Dev] Re: PEP 326 now online
- Next message: [Python-Dev] Re: Re: PEP 326 now online
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
[Guido] > Hm. cmp is a builtin function. That seems an exceedingly odd place > to stick arbitrary constants -- much more so than type objects (like > Martin's recently proposed unicode property for controlling error > handling).
If the high/low (or hi/lo, Max/Min, etc.) objects themselves are subclasses of object, it may make sense to just place them at object.high/object.low.
Why two subclasses? Shouldn't one with two instances suffice?
One idea was to create a type called 'extreme', bind it to cmp.extreme, and subclass high/low from extreme. Of course that is just one more arbitrary object attached to cmp, which is even more odd.
Another option would be for min.Min and max.Max, but I'm pretty sure that would be confusing. The convenient part about putting them as attributes of cmp is that it is obvious that they are most useful when it comes to comparing against other objects.
I'm not convinced.
--Guido van Rossum (home page: http://www.python.org/~guido/)
- Previous message: [Python-Dev] Re: PEP 326 now online
- Next message: [Python-Dev] Re: Re: PEP 326 now online
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]