Skip to content

Starting to support pypy3.11, need guidance for a cfg stanza #4755

Answered by davidhewitt
mattip asked this question in Questions
Discussion options

You must be logged in to vote

We define our cfgs so that Py_3_11 will be set for Python versions 3.11 and up, which will include PyPy if we detect that version.

So to get "compiling for PyPy with at least a 3.11 interpreter", you can use cfg(all(PyPy, Py_3_11)).

So for this full clause, you'd want to change it to something like

#[cfg(
    all(
        not(Py_3_13), // CPython exposed as a function in 3.13, in object.h 
        not(all(PyPy, not(Py_3_11))) // PyPy exposed as a function until PyPy 3.10, used macro in 3.11+
    )
)]
pub unsafe fn PyObject_DelAttr(o: *mut PyObject, attr_name: *mut PyObject) -> c_int { 
    PyObject_SetAttr(o, attr_name, std::ptr::null_mut()) 
} 

... amusing that CPython went the other dir…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@davidhewitt
Comment options

Answer selected by mattip
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants