[Python-Dev] python 3.0, tp_compare not used for == test? (original) (raw)
"Martin v. Löwis" martin at v.loewis.de
Mon Feb 2 22:57:44 CET 2009
- Previous message: [Python-Dev] python 3.0, tp_compare not used for == test?
- Next message: [Python-Dev] pprint(iterator)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I'm wondering if Mark should add the exception he recently removed back in as a Deprecation Warning when tpcompare is defined, but tprichcompare 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 tpcompare 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).
Mark removed the cmpfunc typedef; that should cause compilation in many extension modules (except those which don't actually cast to cmpfunc, but get the type right in the first place).
Also, if you then investigate why it doesn't get called, you'll notice quickly that the slot doesn't even have the right name anymore. So Campbell's surprise would be gone - he wouldn't have been able to still invoke tp_compare through the cmp() builtin.
Regards, Martin
- Previous message: [Python-Dev] python 3.0, tp_compare not used for == test?
- Next message: [Python-Dev] pprint(iterator)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]