[Python-Dev] python 3.0, tp_compare not used for == test?

Nick Coghlan ncoghlan at gmail.com
Mon Feb 2 11:36:29 CET 2009


Terry Reedy wrote:
> Campbell Barton wrote:
> In 3.0, the build-in cmp() should have been removed and will be for
> 3.0.1.  Do not use it.  I believe the tp_compare slot should not be used
> either.  It will become reserved.  It will not be removed only because
> that would change the binary layout.

I'm wondering if Mark should add the exception he recently removed back
in as a Deprecation Warning when tp_compare is defined, but
tp_richcompare is not. Such a warning should also be present when
running with -3 in 2.7 (assuming it isn't already there).

Otherwise we're going to get more questions like Campbell's wondering if
it is intentional that tp_compare is no longer getting called in the 3.x
series (the warnings would both make it explicit and give guidance on
what to do about it).

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------


More information about the Python-Dev mailing list