RichCompare and RichCompareBool

Aaron Brady castironpi at gmail.com
Mon Mar 9 11:51:38 EDT 2009


On Mar 9, 10:42 am, Mark Dickinson <dicki... at gmail.com> wrote:
> On Mar 9, 3:22 pm, Aaron Brady <castiro... at gmail.com> wrote:
>
> > My complaint was that the docs for the function, as well as its name,
> > are misleading.  RichCompareBool should not take the short cut, and "x
> > in [x]" should call something else that does.  (I am not arguing
> > against the decided behavior of "x in [x]", btw.  There's no clear
> > case IMO.)
>
> I agree the docs are misleading.  A doc patch would very likely
> be accepted.  Changing the behaviour or name of
> PyObject_RichCompareBool would be trickier, since
> that would risk breaking 3rd party extensions that depend
> on the current behaviour.
>
> Mark

Changing the docs for RichCompareBool is a different story from adding
a second function (and naming it).  The docs should mention the
additional test.

A second function should be called something similar, but
RichCompareAsBool is probably too similar.

The actual name for RichCompareBool should be more like something like
ContainerMemberCompare.  It's not that important that it needs be
phased out eventually, either, anyway.





More information about the Python-list mailing list