PyO3 v0.8.0 Release Notes

Release Date: 2018-09-05 // over 5 years ago
  • โž• Added

    • module argument to pyclass macro. #499
    • py_run! macro #512
    • Use existing fields and methods before calling custom getattr. #505
    • PyBytes can now be indexed just like Vec<u8>
    • Implement IntoPy<PyObject> for PyRef and PyRefMut.

    ๐Ÿ”„ Changed

    • Implementing the Using the gc parameter for pyclass (e.g. #[pyclass(gc)]) without implementing the class::PyGCProtocol trait is now a compile-time error. Failing to implement this trait could lead to segfaults. #532
    • ๐Ÿ‘€ PyByteArray::data has been replaced with PyDataArray::to_vec because returning a &[u8] is unsound. (See this comment for a great write-up for why that was unsound)
    • Replace mashup with paste.
    • ๐Ÿš€ GILPool gained a Python marker to prevent it from being misused to release Python objects without the GIL held.

    โœ‚ Removed

    • IntoPyObject was replaced with IntoPy<PyObject>
    • #[pyclass(subclass)] is hidden a unsound-subclass feature because it's causing segmentation faults.

    ๐Ÿ›  Fixed

    • More readable error message for generics in pyclass #503