At the end of the day, len(ob)
just defers to ob.__len__()
so both are correct, just one's more functional and one's more object oriented.
charolastra
Also bash
notitsbot
Came here to say this
Well I'll be..! I wonder if that's how they came up with the word?
Took me a few reads
The second edition was published last Feb (2023) I believe. I read it on my Kindle, having "flicked through" the online version about 6 months prior, and yeah having it page by page with bookmarks etc was almost as good as paper, but far superior to the web version and I was able to read it cover to cover and gain a lot from it. I immediately then read about 4 other books on Rust! Can recommend "Rust Atomics & Locks" by Mara Bos, and "Rust for Rustaceans" by Jon Gjengset for the next level up.
Agree. The official book is a really good start though, and available for free. https://doc.rust-lang.org/stable/book/
What about figuratively?
You just have to push through
Keyword "typically". If I'm overriding dunder methods, then I'll typically need to call the super method as well. It's not like it's forbidden.
Consider the following:
Both of the above return values are perfectly valid Python.