i’m flabbergasted that you’re setting expectations for Rust from Python.
Rust is strongly typed,
Rust is not being targeted at the use-cases of python.
Rust is being targetted at the use-cases of C++, and C++ users are used to doing this sort of thing. I don’t think this qualifies as ‘abuse’ compared to the way the C++ stdlib handles fileIO …
And I don’t think this is breaking intuition at all. It’s still ‘a function comparing values, returning a bool’ … comparing an array , why would I expect to get anything other than an array of bools ?
(in seven years of teaching computational physics)
one of the most enthusiastic operator overloaders I worked with was a trained physicist. He pushed the use of ‘bitwise or’, | ,for dot products . It did get a lot of complaints … but in the end it made sense. It was an amazingly common operation , and allowing it as an infix operator led to writing expressions very easily (mapping from how you think about something to how you write it).
I did actually originally complain that I wanted ‘bitwise or’ available for the select masks… but ultimately it still worked with that, because the types could always get the correct meaning.
Ultimately as well as types, you have variable names …and the surrounding context. ((a>b) | (c>d)).vselect(e,f) … there it’s clearly bitwise or. other times it was clearly dot.
if we could handle that back then in C++, I’m sure in the modern day with much better IDEs, Q&A sites like stack overflow, and this updated language with the whole feature of traits aimed at improving error messages, it will be fine.