(no title)
mvhvv | 3 years ago
I agree scope leakage is a major stumbling block with Python for sure, but it only occurs with control-flow so rarely causes actual issues once you're aware of it. Aside from that my biggest qualms with Python are the typesystem and whitespace for scoping, but those two don't cause much trouble for typical scripting purposes.
And, for what it's worth, Python's f-strings have been the go-to string formatting approach since 2016 so your example becomes something like:
print(f"Hello {name}")
Which is doubly nice because you can also use format specifiers and arbitrary expressions like so: >>> f"The current year is {datetime.now().year} and the value of pi is approximately: {22/7:.2f}"
'The current year is 2022 and the value of pi is approximately: 3.14'
No comments yet.