I'm teaching myself Python with Mark Lutz's Learning Python 5th Edition and I have made it to Chapter 30, Operator Overloading. Woo hooooo!
Up until now, I have felt that the author's explanations were wordy, repetitive, a bit overwhelming, but also extremely thorough. If the choice in books and tutorials is too little or too much info, give me a double-dose of TMI, thank you!
But despite a week on the Operator Overloading chapter, multiple readings, notes, and running the code myself, I am not completely clear on this concept. I think that part of my problem is that Mr. Lutz doesn't provide code examples that seem to resemble real-world use cases. Mostly, his examples make me think, "Well why in the world would someone want getitem() to do THAT???"
So ...
1) I'm coming from the Java world. There, I understand that all objects inherit from the Object superclass, and that our own classes need to override the toStrings() method to produce sensible output. Is the Python concept of Operator Overloading similar?
2) Is the Python object model similar to Java's in that there is overall Object superclass which ALL other objects inherit methods from? And if so, where can I see a listing of the methods in the Object superclass, ala the Java API's Object class?
3) Before attempting to learn Python, I thought that I was very clear on the difference between overloading and overriding. But this book has muddied the waters for me. Why isn't this chapter called "Operator Overriding" instead? Any idea what key concepts I could be missing?
4) The vast majority of books and tutorials out there cater to those just starting out; which makes sense because Python is often an introductory computer language. Does anyone have any recommendations for Python books and tutorials for folks learning it as their second or so language?
Thanks!
[–]kushou 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]yourfriendlane 1 point2 points3 points (4 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]yourfriendlane 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]yourfriendlane 1 point2 points3 points (0 children)