Conversation
davidhewitt
left a comment
There was a problem hiding this comment.
Thanks, a couple of these seals are probably not needed, the rest look good to me!
src/impl_/pyclass.rs
Outdated
| mod pyclass_base_type { | ||
| use crate::impl_::pyclass::PyClassBaseType; | ||
|
|
||
| pub trait Sealed {} | ||
|
|
||
| impl<T: PyClassBaseType> Sealed for T {} | ||
| } |
There was a problem hiding this comment.
This seal doesn't achieve anything it seals PyClassBaseType so creates circular logic.
I think it's ok to leave this trait un-sealed, any user-defined type could in principle implement it (maybe let's document it as such).
src/impl_/pyclass.rs
Outdated
| /// Users are discouraged from implementing this trait manually; it is a PyO3 implementation detail | ||
| /// and may be changed at any time. | ||
| pub trait PyClassImpl: Sized + 'static { | ||
| pub trait PyClassImpl: Sized + 'static + generic_pyclass::Sealed { |
There was a problem hiding this comment.
It is expected for user-defined types to implement this trait (via the macros), so there's no point sealing it (it's not a closed set of implementations).
40de57d to
a2d5930
Compare
|
Thanks, I think if you merge main CI will be green. |
a2d5930 to
4cba28d
Compare
4cba28d to
a99c305
Compare
Merging this PR will degrade performance by 10.73%
Performance Changes
Comparing Footnotes
|
Part of #3908
Adds Sealed to traits in
impl_/pyclass.rs