mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Hopefully fix 3-way comparisons. This unfortunately adds yet another
hack, and it's even more disgusting than a PyInstance_Check() call. If the tp_compare slot is the slot used for overrides in Python, it's always called. Add some tests that show what should work too.
This commit is contained in:
parent
eb94905265
commit
ab3b0343b8
4 changed files with 53 additions and 6 deletions
|
@ -346,6 +346,10 @@ extern DL_IMPORT(int) PyNumber_CoerceEx(PyObject **, PyObject **);
|
|||
|
||||
extern DL_IMPORT(void) (*PyObject_ClearWeakRefs)(PyObject *);
|
||||
|
||||
/* A slot function whose address we need to compare */
|
||||
extern int _PyObject_SlotCompare(PyObject *, PyObject *);
|
||||
|
||||
|
||||
/* PyObject_Dir(obj) acts like Python __builtin__.dir(obj), returning a
|
||||
list of strings. PyObject_Dir(NULL) is like __builtin__.dir(),
|
||||
returning the names of the current locals. In this case, if there are
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue