This repository has been archived by the owner on Jun 5, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
0.20
->0.21
Release Notes
pyo3/pyo3 (pyo3)
v0.21.2
Compare Source
Changed
PySet::empty()
gil-ref constructor. #4082Fixed
async fn
in#[pymethods]
with a&self
receiver and more than one additional argument. #4035__traverse__
. #4045#[pyclass]
living in a different Rust module using theexperimental-declarative-modules
feature. #4054missing_docs
lint triggering on documented#[pymodule]
functions. #4067libpython
). #4073v0.21.1
Compare Source
Added
Send
andSync
forPyBackedStr
andPyBackedBytes
. #4007Clone
,Debug
,PartialEq
,Eq
,PartialOrd
,Ord
andHash
implementation forPyBackedBytes
andPyBackedStr
, andDisplay
forPyBackedStr
. #4020import_exception_bound!
macro to import exception types without generating GIL Ref functionality for them. #4027Changed
#[setter]
function arguments. #3998#[inline]
hints on manyBound
andBorrowed
methods. #4024Fixed
#[pyo3(from_py_with = "")]
in#[setter]
methods #3995&Bound
in#[setter]
methods. #3998#[pymodule]
,#[pyfunction]
and#[pyclass]
macros. #4009pyo3::import_exception!
does not exist. #4012#[pymethod]
with a receiver and additional arguments. #4015v0.21.0
Compare Source
Added
PyMemoryView
type. #3514async fn
in for#[pyfunction]
and#[pymethods]
, with theexperimental-async
feature. #3540 #3588 #3599 #3931PyTypeInfo
forPyEllipsis
,PyNone
andPyNotImplemented
. #3577#[pyclass]
on enums that have non-unit variants. #3582chrono
feature withabi3
feature. #3664FromPyObject
,IntoPy<PyObject>
andToPyObject
are implemented onstd::duration::Duration
#3670PyString::to_cow
. AddPy<PyString>::to_str
,Py<PyString>::to_cow
, andPy<PyString>::to_string_lossy
, as ways to access Python string data safely beyond the GIL lifetime. #3677Bound<T>
andBorrowed<T>
smart pointers as a new API for accessing Python objects. #3686PyNativeType::as_borrowed
to convert "GIL refs" to the newBound
smart pointer. #3692FromPyObject::extract_bound
method, to migrateFromPyObject
implementations to the Bound API. #3706gil-refs
feature to allow continued use of the deprecated GIL Refs APIs. #3707PyAnyMethods
for binary operators (add
,sub
, etc.) #3712chrono-tz
feature allowing conversion betweenchrono_tz::Tz
andzoneinfo.ZoneInfo
#3730PyType_GetModuleByDef
. #3734std::time::SystemTime
anddatetime.datetime
#3736Py::as_any
andPy::into_any
. #3785PyStringMethods::encode_utf8
. #3801PyBackedStr
andPyBackedBytes
, as alternatives to&str
and&bytes
where a Python object owns the data. #3802 #3991#[pymodule]
macro on Rustmod
blocks, with theexperimental-declarative-modules
feature. #3815ExactSizeIterator
forset
andfrozenset
iterators onabi3
feature. #3849Py::drop_ref
to explicitly drop a `Py`` and immediately decrease the Python reference count if the GIL is already held. #3871#[pymodule]
macro on single argument functions that take&Bound<'_, PyModule>
. #3905FromPyObject
forCow<str>
. #3928Default
forGILOnceCell
. #3971PyDictMethods::into_mapping
,PyListMethods::into_sequence
andPyTupleMethods::into_sequence
. #3982Changed
PyDict::from_sequence
now takes a single argument of type&PyAny
(previously took two argumentsPython
andPyObject
). #3532Py::is_ellipsis
andPyAny::is_ellipsis
in favour ofany.is(py.Ellipsis())
. #3577PyTypeInfo
functionality into new traitsHasPyGilRef
andPyTypeCheck
. #3600PyTryFrom
andPyTryInto
traits in favor ofany.downcast()
via thePyTypeCheck
andPyTypeInfo
traits. #3601&self
/&mut self
#3609FromPyObject
for set types now also acceptfrozenset
objects as input. #3632FromPyObject
forbool
now also accepts NumPy'sbool_
as input. #3638AsRefSource
associated type toPyNativeType
. #3653.is_true
to.is_truthy
onPyAny
andPy<PyAny>
to clarify that the test is not based on identity with or equality to the True singleton. #3657PyType::name
is nowPyType::qualname
whereasPyType::name
efficiently accesses the full name which includes the module name. #3660Iter(A)NextOutput
types are now deprecated and__(a)next__
can directly return anything which can be converted into Python objects, i.e. awaitables do not need to be wrapped intoIterANextOutput
orOption
any more.Option
can still be used as well and returningNone
will trigger the fast path for__next__
, stopping iteration without having to raise aStopIteration
exception. #3661FromPyObject
onchrono::DateTime<Tz>
for allTz
, not justFixedOffset
andUtc
. #3663PyTzInfoAccess
trait. For the deprecated gil-ref API, the trait is now implemented for&'py PyTime
and&'py PyDateTime
instead ofPyTime
andPyDate
. #3679__traverse__
become no-ops for unsendable pyclasses if on the wrong thread, thereby avoiding hard aborts at the cost of potential leakage. #3689PyNativeType
inpyo3::prelude
. #3692extract::<i64>
(and other integer types) by avoiding call to__index__()
converting the value to an integer for 3.10+. Gives performance improvement of around 30% for successful extraction. #3742FromPyObject
forPy<T>
to justT: PyTypeCheck
. #3776PySet
andPyFrozenSet
iterators now always iterate the equivalent ofiter(set)
. (A "fast path" with no noticeable performance benefit was removed.) #3849FromPyObject
for&str
,Cow<str>
,&[u8]
andCow<[u8]>
onto a temporary traitFromPyObjectBound
whengil-refs
feature is deactivated. #3928GILPool
,Python::with_pool
, andPython::new_pool
. #3947Removed
Fixed
Py_MAX_NDIMS
in favour ofPyBUF_MAX_NDIM
. #3757datetime
types when an invaliddatetime
module is on sys.path. #3818non_local_definitions
lint warning triggered by many PyO3 macros. #3901PyCode
andPyCode_Type
on PyPy:PyCode_Type
is not exposed by PyPy. #3934v0.20.3
Compare Source
Packaging
portable-atomic
dependency. #3619abi3
stable ABI by the environment variablePYO3_USE_ABI3_FORWARD_COMPATIBILITY=1
. #3821Fixed
portable-atomic
to support platforms without 64-bit atomics. #3619either
feature enabled withoutexperimental-inspect
enabled. #3834Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.