[Python-Dev] Rich comparison confusion

Paul Barrett Barrett@stsci.edu
2001年1月19日 12:32:26 -0500 (EST)


Guido van Rossum writes:
 > 
 > ... I can see no valid reason why someone would want to overload
 > a>b different than b<a, ... 
 > 
I agree. But this assumes that the result of A<B and B>A is a
collection of Booleans. In the Interactive Data Language (IDL) these
operators are essentially mapped to ceiling and floor functions which
are not commutative. I personally find this silly, but IDL users
coming to Python may be surprised when the comparison of two Numeric
arrays returns a Boolean-like result.
-- 
Dr. Paul Barrett Space Telescope Science Institute
Phone: 410-338-4475 ESS/Science Software Group
FAX: 410-338-4767 Baltimore, MD 21218

AltStyle によって変換されたページ (->オリジナル) /