-
Notifications
You must be signed in to change notification settings - Fork 905
Closed
Description
I wonder, should we remove the FromPyObject implementation for T: PyClass + Clone while we're making all the changes in 0.27? (Orginally introduced in #730)
I feel like there are several drawbacks to having that implementation:
- it makes the error messages for
.extract()always error thatX: PyClassis not satisfied due to the blanket (maybe we can fix this with a betterdiagnostic::on_unimplementedforFromPyObject) - it makes it easy for users to accidentally clone their data when receiving it as an argument from Python
- it makes it impossible to add users' own
FromPyObjectimplementation for#[pyclass]types which implementClone, due to the blanket. (Unable to implement FromPyObject for #[pyclass] with Clone #4337)
While we're breaking FromPyObject, should we consider removing this implementation?
I can also see an argument for keeping the blanket and instead just documenting it better to mitigate the downsides, to some users it may be convenient and it would be more breakage to remove it.
Metadata
Metadata
Assignees
Labels
No labels