Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Steps towards Python 3.11 support #3231

Merged
merged 2 commits into from
Feb 7, 2022
Merged

Steps towards Python 3.11 support #3231

merged 2 commits into from
Feb 7, 2022

Conversation

vstinner
Copy link
Contributor

  • Replace "Py_TYPE(obj) = type" with:
    "Py_SET_TYPE(obj, type)"
  • Replace "Py_REFCNT(Py_None) += n" with:
    "Py_SET_REFCNT(Py_None, Py_REFCNT(Py_None) + n)"
  • Add pythoncapi_compat.h to get Py_SET_TYPE() and Py_SET_REFCNT() on
    Python 3.9 and older. File copied from:
    https://github.com/pythoncapi/pythoncapi_compat

On Python 3.10, Py_REFCNT() can no longer be used to set a reference
count:

On Python 3.11, Py_TYPE() can no longer be used to set an object
type:

* Replace "Py_TYPE(obj) = type" with:
  "Py_SET_TYPE(obj, type)"
* Replace "Py_REFCNT(Py_None) += n" with:
  "Py_SET_REFCNT(Py_None, Py_REFCNT(Py_None) + n)"
* Add pythoncapi_compat.h to get Py_SET_TYPE() and Py_SET_REFCNT() on
  Python 3.9 and older. File copied from:
  https://github.com/pythoncapi/pythoncapi_compat

On Python 3.10, Py_REFCNT() can no longer be used to set a reference
count:

* https://docs.python.org/dev/c-api/structures.html#c.Py_REFCNT
* https://docs.python.org/dev/whatsnew/3.10.html#id2

On Python 3.11, Py_TYPE() can no longer be used to set an object
type:

* https://docs.python.org/dev/c-api/structures.html#c.Py_TYPE
* https://docs.python.org/dev/whatsnew/3.11.html#id2
@oleksiyskononenko
Copy link
Contributor

oleksiyskononenko commented Jan 28, 2022

Thanks @vstinner.

I guess python 3.11 is at the development stage, so we don't really have a way to test the related developments on this PR.

As for the python 3.10 changes, I missed that Py_REFCNT() can no longer be used to set a reference count and wonder why we didn't see any related test failure when added 3.10 to our pipeline.

@vstinner
Copy link
Contributor Author

As for the python 3.10 changes, I missed that Py_REFCNT() can no longer be used to set a reference count and wonder why we didn't see any related test failure when added 3.10 to our pipeline.

src/core/buffer.cc doesn't use Py_REFCNT(Py_None) += n, but Py_None->ob_refcnt += n: in Python 3.10, accessing directly the PyObject.ob_refcnt is still possible. But it may become an error in a later Python version.

On the other side, Py_TYPE(v) = type.v fails with a compiler error on Python 3.11.

@vstinner
Copy link
Contributor Author

vstinner commented Jan 28, 2022

I built manually Python 3.11 from source on Linux, and I installed it in /opt/py311 (pick your favorite directory):

git clone https://github.com/python/cpython
cd cpython
./configure --prefix /opt/py311
make
make install

Currently, building datatable with Python 3.11 fails with 2 compiler errors on Py_TYPE() used as an l-value:

$ /opt/py311/bin/python3.11 -m venv env
$ env/bin/python -m pip install build
$ env/bin/python -m build 
(...)
[5] Compiling 315 source files
(...)
+==== ERRORS & WARNINGS ========
|
| In file included from /opt/py311/include/python3.11d/Python.h:42,
|                  from src/core/python/python.h:26,
|                  from src/core/python/tuple.cc:22:
| src/core/python/tuple.cc: In member function ‘void py::otuple::make_editable()’:
| src/core/python/tuple.cc:146:5: error: lvalue required as left operand of assignment
|   146 |     Py_TYPE(v_new) = v_type;
|       |     ^~~~~~~
| 
| In file included from /opt/py311/include/python3.11d/Python.h:42,
|                  from src/core/python/python.h:26,
|                  from src/core/python/namedtuple.cc:24:
| src/core/python/namedtuple.cc: In constructor ‘py::onamedtuple::onamedtuple(const py::onamedtupletype&)’:
| src/core/python/namedtuple.cc:131:3: error: lvalue required as left operand of assignment
|   131 |   Py_TYPE(v) = type.v;
|       |   ^~~~~~~
| 
+===============================

With this PR, it builds successfully:

$ /opt/py311/bin/python3.11 -m venv env
$ env/bin/python -m pip install build
$ env/bin/python -m build 
(...)
[5] Compiling 315 source files
(...)
==== Wheel built in 0.367s
Successfully built datatable-1.1.0a0+sdist.1643330741.vstinner.tar.gz and datatable-1.1.0a0+sdist.1643330741.vstinner-cp311-cp311d-linux_x86_64.whl

@vstinner
Copy link
Contributor Author

I guess python 3.11 is at the development stage, so we don't really have a way to test the related developments on this PR.

I agree that it's tedious to use Python 3.11 right now. I'm using Fedora 35 which does provide Python 3.11 (Python version 3.11.0a3)! ... But I got issues while trying to build database using build, an error about distutils and how Fedora changes installation directories :-(

My concern is getting as many Python dependencies as possible compatible with Python 3.11 before Python 3.11 final will be released next October.

Note: I'm also the author of https://www.python.org/dev/peps/pep-0674/ which introduced the incompatible change in Python :-) The PEP explains the rationale for these changes.

@oleksiyskononenko oleksiyskononenko added the improve Improvement of an existing functionality label Feb 7, 2022
@oleksiyskononenko oleksiyskononenko added this to the Release 1.1.0 milestone Feb 7, 2022
@oleksiyskononenko oleksiyskononenko merged commit 02f1311 into h2oai:main Feb 7, 2022
@vstinner vstinner deleted the python311 branch February 7, 2022 18:25
@vstinner
Copy link
Contributor Author

vstinner commented Feb 7, 2022

Great, thank you for merging my fix :-)

Ping me if you get more Python 3.11 compatibility issues ;-)

@oleksiyskononenko
Copy link
Contributor

We will add python 3.11 to our pipeline as long as it is released. If by that time you introduce some more incompatible changes, your help is very much appreciated :)

@oleksiyskononenko
Copy link
Contributor

@vstinner pythoncapi_compat.h produces quite a lot of warnings when built: https://ci.appveyor.com/project/h2oops/datatable/builds/42483085/job/uyx2k5j2abhqsgmu?fullLog=true#L397

Do you think you can fix these warnings on a separate PR?

@vstinner
Copy link
Contributor Author

vstinner commented Feb 8, 2022

Oh. I can reproduce some warnings on Linux using the command:

CC=clang python3.11 ci/ext.py wheel

I see multiple warnings.

NULL:

| /Applications/Xcode-13.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.0.0/include/stddef.h:84:18: note: expanded from macro 'NULL'
| #    define NULL __null
|                  ^
| In file included from src/core/python/namedtuple.cc:22:
| src/core/lib/pythoncapi_compat.h:272:52: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]
|                        || tstate->c_profilefunc != NULL);
|                                                    ^~~~
|                                                    nullptr

size_t vs Py_ssize_t:

| src/core/column/const_na.cc:105:28: warning: implicit conversion changes signedness: 'Py_ssize_t' (aka 'long') to 'unsigned long' [-Wsign-conversion]
|     Py_SET_REFCNT(Py_None, Py_REFCNT(Py_None) + nrows);
|     ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
| /Users/appveyor/.localpython3.9.6/include/python3.9/object.h:123:54: note: expanded from macro 'Py_REFCNT'
| #define Py_REFCNT(ob)           (_PyObject_CAST(ob)->ob_refcnt)
|                                                      ^
| /Users/appveyor/.localpython3.9.6/include/python3.9/object.h:135:70: note: expanded from macro 'Py_SET_REFCNT'
| #define Py_SET_REFCNT(ob, refcnt) _Py_SET_REFCNT(_PyObject_CAST(ob), refcnt)
|                                                                      ^~~~~~

"use of old-style cast":

| In file included from src/core/buffer.cc:27:
| src/core/lib/pythoncapi_compat.h:170:12: warning: use of old-style cast [-Wold-style-cast]
|     return (PyCodeObject *)_Py_StealRef(PyFrame_GetCode(frame));
|            ^               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| src/core/lib/pythoncapi_compat.h:188:12: warning: use of old-style cast [-Wold-style-cast]
|     return (PyFrameObject *)_Py_XStealRef(PyFrame_GetBack(frame));
|            ^                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| src/core/lib/pythoncapi_compat.h:218:12: warning: use of old-style cast [-Wold-style-cast]
|     return (PyFrameObject *)_Py_XStealRef(PyThreadState_GetFrame(tstate));
|            ^                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@vstinner
Copy link
Contributor Author

vstinner commented Feb 8, 2022

  • size_t vs Py_ssize_t: I proposed Fix compiler warnings on Py_SET_REFCNT() #3236 to fix it
  • "use of old-style cast": the static inline in defined inside an extern "C" { ... } block. I don't know how to avoid this warning. It's a C header file.
  • NULL: same.

I see different options:

  • Turn off these warnings when including the header file using pragma.
  • Remove the code from pythoncapi_compat.h which is not used by datatable.
  • Write a C++ flavor of pythoncapi_compat.h using static_cast<> and nullptr. That's more work :-/

@oleksiyskononenko
Copy link
Contributor

Thanks, @vstinner. So pythoncapi_compat.h has no C++ version?

@oleksiyskononenko
Copy link
Contributor

I believe extern "C" { ... } only controls linkage, and, since we're using C++ compiler to compile datatable, the code within such blocks is compiled as C++ code. For instance, I can get rid of multiple warnings by simply replacing NULL with nullptr in pythoncapi_compat.h. We have some other extern "C" { ... } blocks in datatable and many of them use nullptr.

As for the static casting, it doesn't work

src/core/lib/pythoncapi_compat.h:170:12: error: static_cast from 'PyObject *' (aka '_object *') to 'PyCodeObject *', which are not related by inheritance, is not allowed

Could you please provide some details as to what kind of casting you're doing in pythoncapi_compat.h? For instance, here.

@vstinner
Copy link
Contributor Author

vstinner commented Feb 9, 2022

I'm working on a pythoncapi_compat.h update to make it compatible with C++. I created #3237 to check if there are still warnings on pythoncapi_compat.h when built by datatable, before merging it in my upstream project.

@vstinner
Copy link
Contributor Author

vstinner commented Feb 9, 2022

I don't understand why the C++ compiler only complains about pythoncapi_compat.h whereas Python.h is far from being C++ compatible. For example, Python.h defines Py_REFCNT() which also uses old-style cast:

#define _PyObject_CAST_CONST(op) ((const PyObject*)(op))

static inline Py_ssize_t _Py_REFCNT(const PyObject *ob) {
    return ob->ob_refcnt;
}

#define Py_REFCNT(ob) _Py_REFCNT(_PyObject_CAST_CONST(ob))

datatable uses Py_REFCNT(), so it should also emit warnings, no?

@oleksiyskononenko
Copy link
Contributor

@vstinner which python is it? For Python 3.9 Python.h is just a set of includes.

@vstinner
Copy link
Contributor Author

Python.h includes object.h which defines the Py_REFCNT() macro and static inline function. In recent Python functions, a static inline fnuction is used. Previously, it was only a macro.

@oleksiyskononenko
Copy link
Contributor

With this PR, it builds successfully:

@vstinner Actually, I'm now trying to build datatable with the officially released python 3.11 and get quite a lot of warnings/errors. Wasn't it the case for you when you built datatable with the python 3.11 dev version?

Compiling [##..........................................................] 4/322
In file included from src/core/csv/reader_fread.cc:23:
In file included from src/core/column.h:25:
In file included from src/core/stats.h:27:
In file included from src/core/cstring.h:25:
In file included from src/core/buffer.h:29:
In file included from src/core/python/python.h:26:
In file included from /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/Python.h:43:
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/pybuffer.h:33:3: error: typedef redefinition with different types ('struct Py_buffer' vs 'struct bufferinfo')
} Py_buffer;
  ^
src/core/_dt.h:35:28: note: previous definition is here
typedef struct bufferinfo  Py_buffer;
                           ^
In file included from src/core/csv/reader_fread.cc:23:
In file included from src/core/column.h:25:
In file included from src/core/stats.h:27:
In file included from src/core/cstring.h:25:
In file included from src/core/buffer.h:29:
In file included from src/core/python/python.h:26:
In file included from /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/Python.h:58:
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/memoryobject.h:46:15: error: field has incomplete type 'Py_buffer' (aka 'bufferinfo')
    Py_buffer master; /* snapshot buffer obtained from the original exporter */
              ^
src/core/_dt.h:35:16: note: forward declaration of 'bufferinfo'
typedef struct bufferinfo  Py_buffer;
               ^
In file included from src/core/csv/reader_fread.cc:23:
In file included from src/core/column.h:25:
In file included from src/core/stats.h:27:
In file included from src/core/cstring.h:25:
In file included from src/core/buffer.h:29:
In file included from src/core/python/python.h:26:
In file included from /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/Python.h:58:
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/memoryobject.h:63:15: error: field has incomplete type 'Py_buffer' (aka 'bufferinfo')
    Py_buffer view;               /* private copy of the exporter's view */
              ^
src/core/_dt.h:35:16: note: forward declaration of 'bufferinfo'
typedef struct bufferinfo  Py_buffer;
               ^
In file included from src/core/csv/reader_fread.cc:23:
In file included from src/core/column.h:25:
In file included from src/core/stats.h:27:
In file included from src/core/cstring.h:25:
src/core/buffer.h:304:3: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  Py_SETREF(data[i], value);
  ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/cpython/object.h:335:9: note: expanded from macro 'Py_SETREF'
        Py_DECREF(_py_tmp);                     \
        ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:541:23: note: expanded from macro 'Py_DECREF'
#define Py_DECREF(op) Py_DECREF(_PyObject_CAST(op))
                      ^
1 warning and 3 errors generated.

In file included from src/core/python/obj.cc:24:
In file included from src/core/cstring.h:25:
In file included from src/core/buffer.h:29:
In file included from src/core/python/python.h:26:
In file included from /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/Python.h:43:
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/pybuffer.h:33:3: error: typedef redefinition with different types ('struct Py_buffer' vs 'struct bufferinfo')
} Py_buffer;
  ^
src/core/_dt.h:35:28: note: previous definition is here
typedef struct bufferinfo  Py_buffer;
                           ^
In file included from src/core/python/obj.cc:24:
In file included from src/core/cstring.h:25:
In file included from src/core/buffer.h:29:
In file included from src/core/python/python.h:26:
In file included from /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/Python.h:58:
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/memoryobject.h:46:15: error: field has incomplete type 'Py_buffer' (aka 'bufferinfo')
    Py_buffer master; /* snapshot buffer obtained from the original exporter */
              ^
src/core/_dt.h:35:16: note: forward declaration of 'bufferinfo'
typedef struct bufferinfo  Py_buffer;
               ^
In file included from src/core/python/obj.cc:24:
In file included from src/core/cstring.h:25:
In file included from src/core/buffer.h:29:
In file included from src/core/python/python.h:26:
In file included from /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/Python.h:58:
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/memoryobject.h:63:15: error: field has incomplete type 'Py_buffer' (aka 'bufferinfo')
    Py_buffer view;               /* private copy of the exporter's view */
              ^
src/core/_dt.h:35:16: note: forward declaration of 'bufferinfo'
typedef struct bufferinfo  Py_buffer;
               ^
In file included from src/core/python/obj.cc:24:
In file included from src/core/cstring.h:25:
src/core/buffer.h:304:3: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  Py_SETREF(data[i], value);
  ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/cpython/object.h:335:9: note: expanded from macro 'Py_SETREF'
        Py_DECREF(_py_tmp);                     \
        ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:541:23: note: expanded from macro 'Py_DECREF'
#define Py_DECREF(op) Py_DECREF(_PyObject_CAST(op))
                      ^
In file included from src/core/python/obj.cc:25:
In file included from src/core/expr/py_by.h:25:
src/core/python/xobject.h:296:24: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
    PyTypeObject* tp = Py_TYPE(self);
                       ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:129:3: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  Py_XINCREF(v);
  ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:596:26: note: expanded from macro 'Py_XINCREF'
#  define Py_XINCREF(op) Py_XINCREF(_PyObject_CAST(op))
                         ^
src/core/python/obj.cc:134:3: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  Py_XINCREF(v);
  ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:596:26: note: expanded from macro 'Py_XINCREF'
#  define Py_XINCREF(op) Py_XINCREF(_PyObject_CAST(op))
                         ^
src/core/python/obj.cc:150:3: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  Py_XINCREF(v);
  ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:596:26: note: expanded from macro 'Py_XINCREF'
#  define Py_XINCREF(op) Py_XINCREF(_PyObject_CAST(op))
                         ^
src/core/python/obj.cc:151:3: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  Py_XDECREF(t);
  ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:606:26: note: expanded from macro 'Py_XDECREF'
#  define Py_XDECREF(op) Py_XDECREF(_PyObject_CAST(op))
                         ^
src/core/python/obj.cc:159:3: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  Py_XDECREF(t);
  ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:606:26: note: expanded from macro 'Py_XDECREF'
#  define Py_XDECREF(op) Py_XDECREF(_PyObject_CAST(op))
                         ^
src/core/python/obj.cc:194:10: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  if (v) Py_DECREF(v);
         ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:541:23: note: expanded from macro 'Py_DECREF'
#define Py_DECREF(op) Py_DECREF(_PyObject_CAST(op))
                      ^
src/core/python/obj.cc:227:60: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
bool _obj::is_int()           const noexcept { return v && PyLong_Check(v) && !is_bool(); }
                                                           ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/longobject.h:13:29: note: expanded from macro 'PyLong_Check'
        PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS)
                            ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:227:60: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/longobject.h:13:29: note: expanded from macro 'PyLong_Check'
        PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS)
                            ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:228:60: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
bool _obj::is_float()         const noexcept { return v && PyFloat_Check(v); }
                                                           ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/floatobject.h:16:27: note: expanded from macro 'PyFloat_Check'
#define PyFloat_Check(op) PyObject_TypeCheck(op, &PyFloat_Type)
                          ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:266:40: note: expanded from macro 'PyObject_TypeCheck'
#  define PyObject_TypeCheck(ob, type) PyObject_TypeCheck(_PyObject_CAST(ob), type)
                                       ^
src/core/python/obj.cc:230:60: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
bool _obj::is_string()        const noexcept { return v && PyUnicode_Check(v); }
                                                           ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/unicodeobject.h:115:25: note: expanded from macro 'PyUnicode_Check'
    PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_UNICODE_SUBCLASS)
                        ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:230:60: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/unicodeobject.h:115:25: note: expanded from macro 'PyUnicode_Check'
    PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_UNICODE_SUBCLASS)
                        ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:231:60: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
bool _obj::is_bytes()         const noexcept { return v && PyBytes_Check(v); }
                                                           ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/bytesobject.h:31:38: note: expanded from macro 'PyBytes_Check'
                 PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_BYTES_SUBCLASS)
                                     ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:231:60: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/bytesobject.h:31:38: note: expanded from macro 'PyBytes_Check'
                 PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_BYTES_SUBCLASS)
                                     ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:234:60: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
bool _obj::is_pytype()        const noexcept { return v && PyType_Check(v); }
                                                           ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:781:28: note: expanded from macro 'PyType_Check'
#  define PyType_Check(op) PyType_Check(_PyObject_CAST(op))
                           ^
src/core/python/obj.cc:239:60: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
bool _obj::is_list()          const noexcept { return v && PyList_Check(v); }
                                                           ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/listobject.h:25:25: note: expanded from macro 'PyList_Check'
    PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LIST_SUBCLASS)
                        ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:239:60: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/listobject.h:25:25: note: expanded from macro 'PyList_Check'
    PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LIST_SUBCLASS)
                        ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:240:60: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
bool _obj::is_tuple()         const noexcept { return v && PyTuple_Check(v); }
                                                           ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/tupleobject.h:27:38: note: expanded from macro 'PyTuple_Check'
                 PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_TUPLE_SUBCLASS)
                                     ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:240:60: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/tupleobject.h:27:38: note: expanded from macro 'PyTuple_Check'
                 PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_TUPLE_SUBCLASS)
                                     ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:241:60: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
bool _obj::is_dict()          const noexcept { return v && PyDict_Check(v); }
                                                           ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/dictobject.h:18:38: note: expanded from macro 'PyDict_Check'
                 PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_DICT_SUBCLASS)
                                     ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:241:60: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/dictobject.h:18:38: note: expanded from macro 'PyDict_Check'
                 PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_DICT_SUBCLASS)
                                     ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:243:60: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
bool _obj::is_range()         const noexcept { return v && PyRange_Check(v); }
                                                           ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/rangeobject.h:22:27: note: expanded from macro 'PyRange_Check'
#define PyRange_Check(op) Py_IS_TYPE(op, &PyRange_Type)
                          ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:153:32: note: expanded from macro 'Py_IS_TYPE'
#  define Py_IS_TYPE(ob, type) Py_IS_TYPE(_PyObject_CAST(ob), type)
                               ^
src/core/python/obj.cc:244:60: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
bool _obj::is_slice()         const noexcept { return v && PySlice_Check(v); }
                                                           ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/sliceobject.h:31:27: note: expanded from macro 'PySlice_Check'
#define PySlice_Check(op) Py_IS_TYPE(op, &PySlice_Type)
                          ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:153:32: note: expanded from macro 'Py_IS_TYPE'
#  define Py_IS_TYPE(ob, type) Py_IS_TYPE(_PyObject_CAST(ob), type)
                               ^
src/core/python/obj.cc:245:60: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
bool _obj::is_generator()     const noexcept { return v && PyGen_Check(v); }
                                                           ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/cpython/genobject.h:40:25: note: expanded from macro 'PyGen_Check'
#define PyGen_Check(op) PyObject_TypeCheck(op, &PyGen_Type)
                        ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:266:40: note: expanded from macro 'PyObject_TypeCheck'
#  define PyObject_TypeCheck(ob, type) PyObject_TypeCheck(_PyObject_CAST(ob), type)
                                       ^
src/core/python/obj.cc:344:43: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  return v && reinterpret_cast<PyObject*>(Py_TYPE(v)) == FExpr_Type;
                                          ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:355:24: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  if (v == Py_None || (PyFloat_Check(v) && std::isnan(PyFloat_AS_DOUBLE(v)))) {
                       ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/floatobject.h:16:27: note: expanded from macro 'PyFloat_Check'
#define PyFloat_Check(op) PyObject_TypeCheck(op, &PyFloat_Type)
                          ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:266:40: note: expanded from macro 'PyObject_TypeCheck'
#  define PyObject_TypeCheck(ob, type) PyObject_TypeCheck(_PyObject_CAST(ob), type)
                                       ^
src/core/python/obj.cc:388:7: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  if (PyLong_CheckExact(v)) {
      ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/longobject.h:14:31: note: expanded from macro 'PyLong_CheckExact'
#define PyLong_CheckExact(op) Py_IS_TYPE(op, &PyLong_Type)
                              ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:153:32: note: expanded from macro 'Py_IS_TYPE'
#  define Py_IS_TYPE(ob, type) Py_IS_TYPE(_PyObject_CAST(ob), type)
                               ^
src/core/python/obj.cc:409:7: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  if (PyLong_Check(v)) {
      ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/longobject.h:13:29: note: expanded from macro 'PyLong_Check'
        PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS)
                            ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:409:7: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/longobject.h:13:29: note: expanded from macro 'PyLong_Check'
        PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS)
                            ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:447:7: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  if (PyLong_Check(v)) {
      ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/longobject.h:13:29: note: expanded from macro 'PyLong_Check'
        PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS)
                            ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:447:7: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/longobject.h:13:29: note: expanded from macro 'PyLong_Check'
        PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS)
                            ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:507:9: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
        Py_DECREF(num);
        ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:541:23: note: expanded from macro 'Py_DECREF'
#define Py_DECREF(op) Py_DECREF(_PyObject_CAST(op))
                      ^
src/core/python/obj.cc:521:7: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  if (PyFloat_Check(v)) {
      ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/floatobject.h:16:27: note: expanded from macro 'PyFloat_Check'
#define PyFloat_Check(op) PyObject_TypeCheck(op, &PyFloat_Type)
                          ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:266:40: note: expanded from macro 'PyObject_TypeCheck'
#  define PyObject_TypeCheck(ob, type) PyObject_TypeCheck(_PyObject_CAST(ob), type)
                                       ^
src/core/python/obj.cc:568:7: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  if (PyUnicode_Check(v)) {
      ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/unicodeobject.h:115:25: note: expanded from macro 'PyUnicode_Check'
    PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_UNICODE_SUBCLASS)
                        ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:568:7: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/unicodeobject.h:115:25: note: expanded from macro 'PyUnicode_Check'
    PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_UNICODE_SUBCLASS)
                        ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:578:7: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  if (PyUnicode_Check(v)) {
      ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/unicodeobject.h:115:25: note: expanded from macro 'PyUnicode_Check'
    PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_UNICODE_SUBCLASS)
                        ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:578:7: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/unicodeobject.h:115:25: note: expanded from macro 'PyUnicode_Check'
    PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_UNICODE_SUBCLASS)
                        ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:598:7: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  if (PyLong_CheckExact(v)) {
      ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/longobject.h:14:31: note: expanded from macro 'PyLong_CheckExact'
#define PyLong_CheckExact(op) Py_IS_TYPE(op, &PyLong_Type)
                              ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:153:32: note: expanded from macro 'Py_IS_TYPE'
#  define Py_IS_TYPE(ob, type) Py_IS_TYPE(_PyObject_CAST(ob), type)
                               ^
src/core/python/obj.cc:617:7: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  if (PyFloat_Check(v)) {
      ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/floatobject.h:16:27: note: expanded from macro 'PyFloat_Check'
#define PyFloat_Check(op) PyObject_TypeCheck(op, &PyFloat_Type)
                          ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:266:40: note: expanded from macro 'PyObject_TypeCheck'
#  define PyObject_TypeCheck(ob, type) PyObject_TypeCheck(_PyObject_CAST(ob), type)
                                       ^
src/core/python/obj.cc:637:8: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  if (!PyLong_Check(v)) {
       ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/longobject.h:13:29: note: expanded from macro 'PyLong_Check'
        PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS)
                            ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:637:8: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/longobject.h:13:29: note: expanded from macro 'PyLong_Check'
        PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS)
                            ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:651:8: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  if (!PyLong_Check(v) || is_bool()) {
       ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/longobject.h:13:29: note: expanded from macro 'PyLong_Check'
        PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS)
                            ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:651:8: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/longobject.h:13:29: note: expanded from macro 'PyLong_Check'
        PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS)
                            ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:667:7: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  if (PyLong_Check(v)) {
      ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/longobject.h:13:29: note: expanded from macro 'PyLong_Check'
        PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS)
                            ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:667:7: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/longobject.h:13:29: note: expanded from macro 'PyLong_Check'
        PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS)
                            ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:688:8: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  if (!PyLong_Check(v) || is_bool()) {
       ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/longobject.h:13:29: note: expanded from macro 'PyLong_Check'
        PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS)
                            ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:688:8: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/longobject.h:13:29: note: expanded from macro 'PyLong_Check'
        PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS)
                            ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:715:7: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  if (PyLong_Check(v)) return py::oint(robj(v));
      ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/longobject.h:13:29: note: expanded from macro 'PyLong_Check'
        PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS)
                            ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:715:7: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/longobject.h:13:29: note: expanded from macro 'PyLong_Check'
        PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS)
                            ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:727:7: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  if (PyLong_Check(v)) return py::oint(robj(v));
      ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/longobject.h:13:29: note: expanded from macro 'PyLong_Check'
        PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS)
                            ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:727:7: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/longobject.h:13:29: note: expanded from macro 'PyLong_Check'
        PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS)
                            ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:743:7: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  if (PyFloat_Check(v)) return PyFloat_AsDouble(v);
      ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/floatobject.h:16:27: note: expanded from macro 'PyFloat_Check'
#define PyFloat_Check(op) PyObject_TypeCheck(op, &PyFloat_Type)
                          ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:266:40: note: expanded from macro 'PyObject_TypeCheck'
#  define PyObject_TypeCheck(ob, type) PyObject_TypeCheck(_PyObject_CAST(ob), type)
                                       ^
src/core/python/obj.cc:745:7: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  if (PyLong_Check(v)) {
      ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/longobject.h:13:29: note: expanded from macro 'PyLong_Check'
        PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS)
                            ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:745:7: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/longobject.h:13:29: note: expanded from macro 'PyLong_Check'
        PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS)
                            ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:756:7: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
      Py_DECREF(num);
      ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:541:23: note: expanded from macro 'Py_DECREF'
#define Py_DECREF(op) Py_DECREF(_PyObject_CAST(op))
                      ^
src/core/python/obj.cc:766:7: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  if (PyFloat_Check(v)) {
      ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/floatobject.h:16:27: note: expanded from macro 'PyFloat_Check'
#define PyFloat_Check(op) PyObject_TypeCheck(op, &PyFloat_Type)
                          ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:266:40: note: expanded from macro 'PyObject_TypeCheck'
#  define PyObject_TypeCheck(ob, type) PyObject_TypeCheck(_PyObject_CAST(ob), type)
                                       ^
src/core/python/obj.cc:772:7: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  if (PyLong_Check(v)) {
      ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/longobject.h:13:29: note: expanded from macro 'PyLong_Check'
        PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS)
                            ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:772:7: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/longobject.h:13:29: note: expanded from macro 'PyLong_Check'
        PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS)
                            ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:800:7: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  if (PyUnicode_Check(v)) {
      ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/unicodeobject.h:115:25: note: expanded from macro 'PyUnicode_Check'
    PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_UNICODE_SUBCLASS)
                        ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:800:7: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/unicodeobject.h:115:25: note: expanded from macro 'PyUnicode_Check'
    PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_UNICODE_SUBCLASS)
                        ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:804:12: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  else if (PyBytes_Check(v)) {
           ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/bytesobject.h:31:38: note: expanded from macro 'PyBytes_Check'
                 PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_BYTES_SUBCLASS)
                                     ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:804:12: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/bytesobject.h:31:38: note: expanded from macro 'PyBytes_Check'
                 PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_BYTES_SUBCLASS)
                                     ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:825:7: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  if (PyUnicode_Check(v)) {
      ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/unicodeobject.h:115:25: note: expanded from macro 'PyUnicode_Check'
    PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_UNICODE_SUBCLASS)
                        ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:825:7: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/unicodeobject.h:115:25: note: expanded from macro 'PyUnicode_Check'
    PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_UNICODE_SUBCLASS)
                        ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:870:7: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  if (PyList_Check(v) || PyTuple_Check(v)) {
      ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/listobject.h:25:25: note: expanded from macro 'PyList_Check'
    PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LIST_SUBCLASS)
                        ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:870:7: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/listobject.h:25:25: note: expanded from macro 'PyList_Check'
    PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LIST_SUBCLASS)
                        ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:870:26: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  if (PyList_Check(v) || PyTuple_Check(v)) {
                         ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/tupleobject.h:27:38: note: expanded from macro 'PyTuple_Check'
                 PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_TUPLE_SUBCLASS)
                                     ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:870:26: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/tupleobject.h:27:38: note: expanded from macro 'PyTuple_Check'
                 PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_TUPLE_SUBCLASS)
                                     ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:871:19: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
    bool islist = PyList_Check(v);
                  ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/listobject.h:25:25: note: expanded from macro 'PyList_Check'
    PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LIST_SUBCLASS)
                        ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:871:19: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/listobject.h:25:25: note: expanded from macro 'PyList_Check'
    PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LIST_SUBCLASS)
                        ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:872:24: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
    Py_ssize_t count = Py_SIZE(v);
                       ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:145:23: note: expanded from macro 'Py_SIZE'
#  define Py_SIZE(ob) Py_SIZE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:878:34: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
        PyObject* item = islist? PyList_GET_ITEM(v, i)
                                 ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/cpython/listobject.h:41:37: note: expanded from macro 'PyList_GET_ITEM'
#define PyList_GET_ITEM(op, index) (_PyList_CAST(op)->ob_item[index])
                                    ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/cpython/listobject.h:29:13: note: expanded from macro '_PyList_CAST'
    (assert(PyList_Check(op)), _Py_CAST(PyListObject*, (op)))
            ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/listobject.h:25:25: note: expanded from macro 'PyList_Check'
    PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LIST_SUBCLASS)
                        ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:878:34: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/cpython/listobject.h:41:37: note: expanded from macro 'PyList_GET_ITEM'
#define PyList_GET_ITEM(op, index) (_PyList_CAST(op)->ob_item[index])
                                    ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/cpython/listobject.h:29:13: note: expanded from macro '_PyList_CAST'
    (assert(PyList_Check(op)), _Py_CAST(PyListObject*, (op)))
            ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/listobject.h:25:25: note: expanded from macro 'PyList_Check'
    PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LIST_SUBCLASS)
                        ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:878:34: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/cpython/listobject.h:41:37: note: expanded from macro 'PyList_GET_ITEM'
#define PyList_GET_ITEM(op, index) (_PyList_CAST(op)->ob_item[index])
                                    ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/cpython/listobject.h:29:13: note: expanded from macro '_PyList_CAST'
    (assert(PyList_Check(op)), _Py_CAST(PyListObject*, (op)))
            ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/listobject.h:25:25: note: expanded from macro 'PyList_Check'
    PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LIST_SUBCLASS)
                        ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:879:34: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
                               : PyTuple_GET_ITEM(v, i);
                                 ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/cpython/tupleobject.h:30:38: note: expanded from macro 'PyTuple_GET_ITEM'
#define PyTuple_GET_ITEM(op, index) (_PyTuple_CAST(op)->ob_item[index])
                                     ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/cpython/tupleobject.h:18:13: note: expanded from macro '_PyTuple_CAST'
    (assert(PyTuple_Check(op)), _Py_CAST(PyTupleObject*, (op)))
            ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/tupleobject.h:27:38: note: expanded from macro 'PyTuple_Check'
                 PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_TUPLE_SUBCLASS)
                                     ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:879:34: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/cpython/tupleobject.h:30:38: note: expanded from macro 'PyTuple_GET_ITEM'
#define PyTuple_GET_ITEM(op, index) (_PyTuple_CAST(op)->ob_item[index])
                                     ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/cpython/tupleobject.h:18:13: note: expanded from macro '_PyTuple_CAST'
    (assert(PyTuple_Check(op)), _Py_CAST(PyTupleObject*, (op)))
            ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/tupleobject.h:27:38: note: expanded from macro 'PyTuple_Check'
                 PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_TUPLE_SUBCLASS)
                                     ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:879:34: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/cpython/tupleobject.h:30:38: note: expanded from macro 'PyTuple_GET_ITEM'
#define PyTuple_GET_ITEM(op, index) (_PyTuple_CAST(op)->ob_item[index])
                                     ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/cpython/tupleobject.h:18:13: note: expanded from macro '_PyTuple_CAST'
    (assert(PyTuple_Check(op)), _Py_CAST(PyTupleObject*, (op)))
            ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/tupleobject.h:27:38: note: expanded from macro 'PyTuple_Check'
                 PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_TUPLE_SUBCLASS)
                                     ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:880:13: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
        if (PyUnicode_Check(item)) {
            ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/unicodeobject.h:115:25: note: expanded from macro 'PyUnicode_Check'
    PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_UNICODE_SUBCLASS)
                        ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:880:13: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/unicodeobject.h:115:25: note: expanded from macro 'PyUnicode_Check'
    PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_UNICODE_SUBCLASS)
                        ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:886:11: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
          Py_DECREF(y);
          ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:541:23: note: expanded from macro 'Py_DECREF'
#define Py_DECREF(op) Py_DECREF(_PyObject_CAST(op))
                      ^
src/core/python/obj.cc:888:13: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
        if (PyBytes_Check(item)) {
            ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/bytesobject.h:31:38: note: expanded from macro 'PyBytes_Check'
                 PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_BYTES_SUBCLASS)
                                     ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:888:13: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/bytesobject.h:31:38: note: expanded from macro 'PyBytes_Check'
                 PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_BYTES_SUBCLASS)
                                     ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:1021:3: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  Py_INCREF(v);
  ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:506:25: note: expanded from macro 'Py_INCREF'
#  define Py_INCREF(op) Py_INCREF(_PyObject_CAST(op))
                        ^
src/core/python/obj.cc:1147:3: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  Py_XDECREF(callable);
  ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:606:26: note: expanded from macro 'Py_XDECREF'
#  define Py_XDECREF(op) Py_XDECREF(_PyObject_CAST(op))
                         ^
src/core/python/obj.cc:1148:3: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  Py_XDECREF(args);
  ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:606:26: note: expanded from macro 'Py_XDECREF'
#  define Py_XDECREF(op) Py_XDECREF(_PyObject_CAST(op))
                         ^
src/core/python/obj.cc:1199:10: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  return Py_TYPE(v);
         ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:1203:22: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  return std::string(Py_TYPE(v)->tp_name);
                     ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:1212:30: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  return static_cast<size_t>(Py_REFCNT(v));
                             ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:127:25: note: expanded from macro 'Py_REFCNT'
#  define Py_REFCNT(ob) Py_REFCNT(_PyObject_CAST(ob))
                        ^
src/core/python/obj.cc:1310:7: error: use of undeclared identifier '_PySys_GetObjectId'; did you mean 'PySys_GetObject'?
      _PySys_GetObjectId(&PyId_stdin)  // borrowed ref
      ^~~~~~~~~~~~~~~~~~
      PySys_GetObject
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/sysmodule.h:10:24: note: 'PySys_GetObject' declared here
PyAPI_FUNC(PyObject *) PySys_GetObject(const char *);
                       ^
src/core/python/obj.cc:1310:26: error: cannot initialize a parameter of type 'const char *' with an rvalue of type '_Py_Identifier *'
      _PySys_GetObjectId(&PyId_stdin)  // borrowed ref
                         ^~~~~~~~~~~
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/sysmodule.h:10:52: note: passing argument to parameter here
PyAPI_FUNC(PyObject *) PySys_GetObject(const char *);
                                                   ^
src/core/python/obj.cc:1320:7: error: use of undeclared identifier '_PySys_GetObjectId'; did you mean 'PySys_GetObject'?
      _PySys_GetObjectId(&PyId_stdout)  // borrowed ref
      ^~~~~~~~~~~~~~~~~~
      PySys_GetObject
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/sysmodule.h:10:24: note: 'PySys_GetObject' declared here
PyAPI_FUNC(PyObject *) PySys_GetObject(const char *);
                       ^
src/core/python/obj.cc:1320:26: error: cannot initialize a parameter of type 'const char *' with an rvalue of type '_Py_Identifier *'
      _PySys_GetObjectId(&PyId_stdout)  // borrowed ref
                         ^~~~~~~~~~~~
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/sysmodule.h:10:52: note: passing argument to parameter here
PyAPI_FUNC(PyObject *) PySys_GetObject(const char *);
                                                   ^
src/core/python/obj.cc:1330:7: error: use of undeclared identifier '_PySys_GetObjectId'; did you mean 'PySys_GetObject'?
      _PySys_GetObjectId(&PyId_stderr)  // borrowed ref
      ^~~~~~~~~~~~~~~~~~
      PySys_GetObject
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/sysmodule.h:10:24: note: 'PySys_GetObject' declared here
PyAPI_FUNC(PyObject *) PySys_GetObject(const char *);
                       ^
src/core/python/obj.cc:1330:26: error: cannot initialize a parameter of type 'const char *' with an rvalue of type '_Py_Identifier *'
      _PySys_GetObjectId(&PyId_stderr)  // borrowed ref
                         ^~~~~~~~~~~~
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/sysmodule.h:10:52: note: passing argument to parameter here
PyAPI_FUNC(PyObject *) PySys_GetObject(const char *);
                                                   ^
src/core/python/obj.cc:1366:63: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  return TypeError() << "Expected a boolean, instead got " << Py_TYPE(o);
                                                              ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:1370:64: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  return TypeError() << "Expected an integer, instead got " << Py_TYPE(o);
                                                               ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:1374:61: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  return TypeError() << "Expected a float, instead got " << Py_TYPE(o);
                                                            ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:1378:60: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  return TypeError() << "Expected a date, instead got " << Py_TYPE(o);
                                                           ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:1382:62: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  return TypeError() << "Expected a string, instead got " << Py_TYPE(o);
                                                             ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:1386:63: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  return TypeError() << "Expected a Groupby, instead got " << Py_TYPE(o);
                                                              ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:1390:64: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  return TypeError() << "Expected a RowIndex, instead got " << Py_TYPE(o);
                                                               ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:1394:61: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  return TypeError() << "Expected a Frame, instead got " << Py_TYPE(o);
                                                            ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:1398:62: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  return TypeError() << "Expected a Column, instead got " << Py_TYPE(o);
                                                             ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:1403:10: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
      << Py_TYPE(o);
         ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:1407:60: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  return TypeError() << "Expected a dict, instead got " << Py_TYPE(o);
                                                           ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:1411:61: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  return TypeError() << "Expected a range, instead got " << Py_TYPE(o);
                                                            ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:1415:61: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  return TypeError() << "Expected a slice, instead got " << Py_TYPE(o);
                                                            ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:1419:62: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  return TypeError() << "Expected an stype, instead got " << Py_TYPE(o);
                                                             ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:1423:60: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  return TypeError() << "Expected a Type, instead got " << Py_TYPE(o);
                                                           ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
src/core/python/obj.cc:1439:65: warning: disabled expansion of recursive macro [-Wdisabled-macro-expansion]
  return TypeError() << "Expected an iterable, instead got " << Py_TYPE(o);
                                                                ^
/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:136:23: note: expanded from macro 'Py_TYPE'
#  define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
                      ^
105 warnings and 9 errors generated.

Error compiling _datatable

make: *** [debug] Error 1

@vstinner
Copy link
Contributor Author

@vstinner Actually, I'm now trying to build datatable with the officially released python 3.11 and get quite a lot of warnings/errors. Wasn't it the case for you when you built datatable with the python 3.11 dev version?

Hi, I suggest you to open a separated issue. Your errors are different than the ones that I tried to address. For exaple:

src/core/_dt.h:35:16: note: forward declaration of 'bufferinfo'
typedef struct bufferinfo  Py_buffer;

You should not redefine Py_buffer type in datatable.

@oleksiyskononenko
Copy link
Contributor

It is actually python 3.11 that redefined it, as we had this type for a long type in datatable :) Anyways, this issue could be easily fixed.

What I wonder is why you had no issues compiling with py311 at the time of this PR and, if something important changed in py311 meanwhile, do you have any suggestions or updates for pythoncapi_compat? Thanks.

@vstinner
Copy link
Contributor Author

What I wonder is why you had no issues compiling with py311 at the time of this PR and, if something important changed in py311 meanwhile

I tested alpha/beta versions of Python 3.11. It was still modified until the Python 3.11 final release. For example, _PySys_GetObjectId() got removed, datatable should not use this private function ;-)

@vstinner
Copy link
Contributor Author

do you have any suggestions or updates for pythoncapi_compat? Thanks.

Sorry, I don't have the bandwidth to investigate these build issues.

@oleksiyskononenko
Copy link
Contributor

I see, what I meant was if you did any improvements to pythoncapi_compat meanwhile that could potentially help? On this PR you committed this file, so I wonder if it is worth updating it and if it is useful for the current py311 release.

@oleksiyskononenko oleksiyskononenko changed the title Add Python 3.11 support Steps towards Python 3.11 support Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improve Improvement of an existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants