Skip to content

use custom error type in pyclass extraction#5413

Merged
Icxolu merged 1 commit intoPyO3:mainfrom
Icxolu:pyclass-extract-error
Sep 7, 2025
Merged

use custom error type in pyclass extraction#5413
Icxolu merged 1 commit intoPyO3:mainfrom
Icxolu:pyclass-extract-error

Conversation

@Icxolu
Copy link
Member

@Icxolu Icxolu commented Sep 4, 2025

This is the idea sketched out in #5391 (comment)

@Icxolu Icxolu force-pushed the pyclass-extract-error branch from 686b39f to 77a517b Compare September 4, 2025 18:44
Copy link
Member

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks good to me 👍

I think for the moment keeping the type opaque is correct, I'm unsure how solving #5412 may impact the complexity of these errors.

@Icxolu Icxolu force-pushed the pyclass-extract-error branch from 77a517b to 7c03db7 Compare September 7, 2025 20:24
@Icxolu
Copy link
Member Author

Icxolu commented Sep 7, 2025

Great, I've added the changelog.

@Icxolu Icxolu enabled auto-merge September 7, 2025 20:25
@Icxolu Icxolu added this pull request to the merge queue Sep 7, 2025
Merged via the queue into PyO3:main with commit ee29399 Sep 7, 2025
42 of 43 checks passed
@Icxolu Icxolu deleted the pyclass-extract-error branch September 7, 2025 22:05
tpoliaw added a commit to tpoliaw/pyo3 that referenced this pull request Nov 4, 2025
Path::into_pyobject now returns a pathlib.Path object which doesn't work
as expected when added to sys.path so revert to string (see PyO3#4925).

`impl FromPyObject for PyRefMut` now returns a custom error type (that
doesn't impl `std::error::Error`) so map the error back the PyErr to
return it (see PyO3#5413).
tpoliaw added a commit to tpoliaw/pyo3 that referenced this pull request Nov 4, 2025
Path::into_pyobject now returns a pathlib.Path object which doesn't work
as expected when added to sys.path so revert to string (see PyO3#4925).

`impl FromPyObject for PyRefMut` now returns a custom error type (that
doesn't impl `std::error::Error`) so map the error back the PyErr to
return it (see PyO3#5413).
github-merge-queue bot pushed a commit that referenced this pull request Nov 8, 2025
Path::into_pyobject now returns a pathlib.Path object which doesn't work
as expected when added to sys.path so revert to string (see #4925).

`impl FromPyObject for PyRefMut` now returns a custom error type (that
doesn't impl `std::error::Error`) so map the error back the PyErr to
return it (see #5413).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants