8 ms·
In their defense, some other languages make the length of a string an attribute/property on a string instance. Python feels like the odd one out here making it
by drizze 7y ago
In their defense, some other languages make the length of a string an attribute/property on a string instance. Python feels like the odd one out here making it a free function you must pass an instance to.
If the tech lead spent a lot of time working with another language that made the length an attribute, I think it would be reasonable for them to need to look it up often.
https://apidock.com/ruby/String/count https://apidock.com/ruby/String/count
https://docs.oracle.com/javase/7/docs/api/java/lang/String.html#length() https://docs.oracle.com/javase/7/docs/api/java/lang/String.h...
https://developer.apple.com/documentation/swift/string/3003522-count https://developer.apple.com/documentation/swift/string/30035...