[Python-Dev] Removing tp_compare? (original) (raw)
Benjamin Peterson benjamin at python.org
Sat Jan 31 22🔞13 CET 2009
- Previous message: [Python-Dev] Removing tp_compare?
- Next message: [Python-Dev] Removing tp_compare?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Sat, Jan 31, 2009 at 3:07 PM, Mark Dickinson <dickinsm at gmail.com> wrote:
Once the cmp removal is complete, the type object's tpcompare slot will no longer be used. The current plan is to rename it to tpreserved, change its type to (void *), and raise TypeError when initializing any type that attempts to put something nonzero into that slot. But another possibility would be to remove it entirely. So...
I think we should keep as tp_reserved in 3.0.1. In 3.1, as I mentioned in the issue, I'd like to reuse it as a slot for bytes. Confusion could be avoided still raising a TypeError for a non-null tp_reserved slot unless the type has Py_TPFLAGS_HAVE_BYTES flag set. After a while, we could just make it default.
N.B. The same questions apply to nbreserved (which used to be nblong) in the PyNumberMethods structure.
IMO, it's fine to keep them around, just in case.
-- Regards, Benjamin
- Previous message: [Python-Dev] Removing tp_compare?
- Next message: [Python-Dev] Removing tp_compare?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]