Closed
Description
After #4245 we have equality between Python str
and Rust str
, which I think is a nice user-facing feature.
There's a possibility to go further here and implement this for more types:
PartialEq<[u8]>
forBound<'py, PyBytes>
seems to fit the same category of behaviourPartialEq<i32>
forBound<'py, PyLong>
, maybe? (And other int types)- similar for floats?
PartialEq<bool>
forBound<'py, PyBool>
?
I think there's a reasonable case to be made that all of these can be implemented without risk of exception.
The main concern I have with these implementations is what to do with Python subclasses - as per #4245 (comment)