2 ms·
Well, the only methods implemented in this class are the __init__ method, which is a constructor and the __str__ method which tells Python what to spit out when
by Wilduck 15y ago
Well, the only methods implemented in this class are the __init__ method, which is a constructor and the __str__ method which tells Python what to spit out when print is called.
Since Python has the capability of duck-typing, if I had an instance of an artist class, and a string with the artists name in it, I could use them in the exact same way with regards to the functionality implemented in the artist class. That is, I could type "print some_artist" and either would print out the name.
But, my larger point was that lines of code is tied in to a much more complex relationship that the developer has with their language and the problem domain. And that this is kind of a silly example to claim that Java is 1.7x more verbose than Python.