From 0c3517a6e0b21a4c8c3201ac1f25b45c85350617 Mon Sep 17 00:00:00 2001 From: David Hewitt <1939362+davidhewitt@users.noreply.github.com> Date: Sat, 20 Feb 2021 07:19:48 +0000 Subject: [PATCH] ffi: further removals --- CHANGELOG.md | 9 +++++---- src/ffi/object.rs | 15 --------------- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d5386698..31665819 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,14 +15,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Change `PyTimeAcces::get_fold()` to return a `bool` instead of a `u8`. [#1397](https://github.com/PyO3/pyo3/pull/1397) - Deprecate FFI definition `PyCFunction_Call` for Python 3.9 and later. [#1425](https://github.com/PyO3/pyo3/pull/1425) - Deprecate FFI definitions `PyModule_GetFilename`. [#1425](https://github.com/PyO3/pyo3/pull/1425) -- Deprecate FFI definitions `PyObject_Check`, `PySuper_Check`, `FreeFunc`. [#1429](https://github.com/PyO3/pyo3/pull/1429) ### Removed - Remove deprecated exception names `BaseException` etc. [#1426](https://github.com/PyO3/pyo3/pull/1426) -- Remove deprecated ffi definitions `PyGetSetDef_INIT`, `PyGetSetDef_DICT`, `PyCoro_Check`, `PyCoroWrapper_Check`, and `PyAsyncGen_Check`. [#1426](https://github.com/PyO3/pyo3/pull/1426) - Remove deprecated redundant methods `Python::is_instance`, `Python::is_subclass`, `Python::release`, `Python::xdecref`, and `Py::from_owned_ptr_or_panic`. [#1426](https://github.com/PyO3/pyo3/pull/1426) -- Remove ffi definition ``PyMethodDef_INIT`. [#1426](https://github.com/PyO3/pyo3/pull/1426) -- Remove FFI definition `PyTypeObject_INIT`. [#1429](https://github.com/PyO3/pyo3/pull/1429) +- Remove many ffi definitions which never existed in the Python C-API: + - (previously deprecated) `PyGetSetDef_INIT`, `PyGetSetDef_DICT`, `PyCoro_Check`, `PyCoroWrapper_Check`, and `PyAsyncGen_Check` [#1426](https://github.com/PyO3/pyo3/pull/1426) + - `PyMethodDef_INIT` [#1426](https://github.com/PyO3/pyo3/pull/1426) + - `PyTypeObject_INIT` [#1429](https://github.com/PyO3/pyo3/pull/1429) + - `PyObject_Check`, `PySuper_Check`, and `FreeFunc` [#1438](https://github.com/PyO3/pyo3/pull/1438) ### Fixed - Remove FFI definition `PyCFunction_ClearFreeList` for Python 3.9 and later. [#1425](https://github.com/PyO3/pyo3/pull/1425) diff --git a/src/ffi/object.rs b/src/ffi/object.rs index b12be6e9..42d5b09c 100644 --- a/src/ffi/object.rs +++ b/src/ffi/object.rs @@ -524,18 +524,3 @@ pub unsafe fn PyType_Check(op: *mut PyObject) -> c_int { pub unsafe fn PyType_CheckExact(op: *mut PyObject) -> c_int { (Py_TYPE(op) == &mut PyType_Type) as c_int } - -#[inline] -#[deprecated(note = "not present in Python headers; to be removed")] -pub fn PyObject_Check(_arg1: *mut PyObject) -> c_int { - 1 -} - -#[inline] -#[deprecated(note = "not present in Python headers; to be removed")] -pub fn PySuper_Check(_arg1: *mut PyObject) -> c_int { - 0 -} - -#[deprecated(note = "not present in Python headers; to be removed")] -pub type FreeFunc = extern "C" fn(*mut c_void) -> c_void;