Skip to content

Add Py_SET_SIZE and Py_RETURN_NOTIMPLEMENTED functions#6003

Open
clin1234 wants to merge 11 commits intoPyO3:mainfrom
clin1234:patch-10
Open

Add Py_SET_SIZE and Py_RETURN_NOTIMPLEMENTED functions#6003
clin1234 wants to merge 11 commits intoPyO3:mainfrom
clin1234:patch-10

Conversation

@clin1234
Copy link
Copy Markdown
Contributor

No description provided.

@alex
Copy link
Copy Markdown
Member

alex commented Apr 25, 2026

Hi -- you are sending a ton of these PRs adding new bindings. Can you explain what your motivation/goals are? It's very hard for us to tell if these add any value, or they're just being added for completeness.

Comment thread pyo3-ffi/src/object.rs
(Py_TYPE(ob) == tp) as c_int
}

// skipped Py_SET_TYPE
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should include Py_SET_TYPE for non-limited API operations?

Comment thread pyo3-ffi/src/object.rs

// skipped Py_RETURN_NONE
#[inline]
pub unsafe fn Py_RETURN_NONE() -> *mut PyObject {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a macro which doesn't make sense to expose for the same reason #5976 was closed.

Comment thread pyo3-ffi/src/object.rs

// skipped Py_RETURN_NOTIMPLEMENTED
#[inline]
pub unsafe fn Py_RETURN_NOTIMPLEMENTED() -> *mut PyObject {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment that this doesn't work like the C macro.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants