You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This code compiles fine in 0.23.3 but fails to compile in 0.23.4.
`Option<chrono::datetime::DateTime<Tz>>` cannot be converted to a Python object
the following trait bounds were not satisfied:
`Option<chrono::datetime::DateTime<Tz>>: pyo3::IntoPyObject<'_>`
which is required by `Option<chrono::datetime::DateTime<Tz>>: IntoPyObjectExt<'_>`
`&Option<chrono::datetime::DateTime<Tz>>: pyo3::IntoPyObject<'_>`
which is required by `&Option<chrono::datetime::DateTime<Tz>>: IntoPyObjectExt<'_>`
`&mut Option<chrono::datetime::DateTime<Tz>>: pyo3::IntoPyObject<'_>`
which is required by `&mut Option<chrono::datetime::DateTime<Tz>>: IntoPyObjectExt<'_>`
`IntoPyObject` is automatically implemented by the `#[pyclass]` macro
if you do not wish to have a corresponding Python type, implement it manually
if you do not own `Option<chrono::datetime::DateTime<Tz>>` you can perform a manual conversion to one of the types in `pyo3::types::*`
Bug Description
This code compiles fine in 0.23.3 but fails to compile in 0.23.4.
This is an
Option<DateTime<Tz>>
This seems to be related to #3266, #4790 (cc @bschoenmaeckers)
Steps to Reproduce
Simplified, this code:
compiles in 0.23.3 but does not compile in 0.23.4.
Backtrace
Your operating system and version
MacOS 15.3
Your Python version (
python --version
)3.11
Your Rust version (
rustc --version
)rustc 1.84.0 (9fc6b4312 2025-01-07)
Your PyO3 version
0.23.3/0.23.4
How did you install python? Did you use a virtualenv?
From uv.
Additional Info
No response
The text was updated successfully, but these errors were encountered: