PyO3 v0.13.0 Release Notes
Release Date: 2020-12-22 // over 3 years ago-
Packaging
- ⬇️ Drop support for Python 3.5 (as it is now end-of-life). #1250
- ⬆️ Bump minimum supported Rust version to 1.45. #1272
- ⬆️ Bump indoc dependency to 1.0. #1272
- ⬆️ Bump paste dependency to 1.0. #1272
- 📇 Rename internal crates
pyo3cls
andpyo3-derive-backend
topyo3-macros
andpyo3-macros-backend
respectively. #1317
➕ Added
- ➕ Add support for building for CPython limited API. Opting-in to the limited API enables a single extension wheel built with PyO3 to be installable on multiple Python versions. This required a few minor changes to runtime behaviour of of PyO3
#[pyclass]
types. See the migration guide for full details. #1152- Add feature flags
abi3-py36
,abi3-py37
,abi3-py38
etc. to set the minimum Python version when using the limited API. #1263
- Add feature flags
- ➕ Add argument names to
TypeError
messages generated by pymethod wrappers. #1212 - ➕ Add FFI definitions for PEP 587 "Python Initialization Configuration". #1247
- Add FFI definitions for
PyEval_SetProfile
andPyEval_SetTrace
. #1255 - ➕ Add FFI definitions for context.h functions (
PyContext_New
, etc). #1259 - ➕ Add
PyAny::is_instance()
method. #1276 - ➕ Add support for conversion between
char
andPyString
. #1282 - Add FFI definitions for
PyBuffer_SizeFromFormat
,PyObject_LengthHint
,PyObject_CallNoArgs
,PyObject_CallOneArg
,PyObject_CallMethodNoArgs
,PyObject_CallMethodOneArg
,PyObject_VectorcallDict
, andPyObject_VectorcallMethod
. #1287 - ➕ Add conversions between
u128
/i128
andPyLong
for PyPy. #1310 - ➕ Add
Python::version()
andPython::version_info()
to get the running interpreter version. #1322 - ➕ Add conversions for tuples of length 10, 11, and 12. #1454
🔄 Changed
- 🔄 Change return type of
PyType::name()
fromCow<str>
toPyResult<&str>
. #1152 #[pyclass(subclass)]
is now required for subclassing from Rust (was previously just required for subclassing from Python). #1152- 🔄 Change
PyIterator
to be consistent with other native types: it is now used as&PyIterator
instead ofPyIterator<'a>
. #1176 - 🔄 Change formatting of
PyDowncastError
messages to be closer to Python's builtin error messages. #1212 - 🔄 Change
Debug
andDisplay
impls forPyException
to be consistent withPyAny
. #1275 - 🔄 Change
Debug
impl ofPyErr
to output more helpful information (acquiring the GIL if necessary). #1275 - Rename
PyTypeInfo::is_instance
andPyTypeInfo::is_exact_instance
toPyTypeInfo::is_type_of
andPyTypeInfo::is_exact_type_of
. #1278 - Optimize
PyAny::call0
,Py::call0
andPyAny::call_method0
andPy::call_method0
on Python 3.9 and up. #1287 - Require double-quotes for pyclass name argument e.g
#[pyclass(name = "MyClass")]
. #1303
🗄 Deprecated
- Deprecate
Python::is_instance
,Python::is_subclass
,Python::release
, andPython::xdecref
. #1292
✂ Removed
- Remove deprecated ffi definitions
PyUnicode_AsUnicodeCopy
,PyUnicode_GetMax
,_Py_CheckRecursionLimit
,PyObject_AsCharBuffer
,PyObject_AsReadBuffer
,PyObject_CheckReadBuffer
andPyObject_AsWriteBuffer
, which will be removed in Python 3.10. #1217 - ✂ Remove unused
python3
feature. #1235
🛠 Fixed
- 🛠 Fix missing field in
PyCodeObject
struct (co_posonlyargcount
) - caused invalid access to other fields in Python >3.7. #1260 - 🐧 Fix building for
x86_64-unknown-linux-musl
target fromx86_64-unknown-linux-gnu
host. #1267 - Fix
#[text_signature]
interacting badly with rustr#raw_identifiers
. #1286 - Fix FFI definitions for
PyObject_Vectorcall
andPyVectorcall_Call
. #1287 - 🛠 Fix building with Anaconda python inside a virtualenv. #1290
- 🛠 Fix definition of opaque FFI types. #1312
- 🛠 Fix using custom error type in pyclass
#[new]
methods. #1319