I like Python; however, I would never trust it for a production system due to its use of dynamically typed variables.
Let's look at a simple example:
def tickets_sold(counts, bonus_multiplier: int):
total = 0
for n in counts:
total += n # total is an int so far
# Later someone "formats for display" and reuses the same variable
total = str(total) # BUG: total is now a string
# Expectation: apply a multiplier to the numeric total
return total * bonus_multiplier
print(tickets_sold([10, 5], 3)) # '15' * 3 -> '151515' (WRONG but no error)
A run of this program produces:
$ python test.py
151515
As you can see, the answer should have been 45 but because total was changed from an integer to a string the total is a nonsensical string and not a total at all. While obviously this is a contrived example, when multiple programmers work on a project with varying levels of skill, this can easily happen in large, production systems. Literally, the left hand often does not know what the right hand is doing and thus the language must protect itself. Python decided not to do this at its inception because it wanted to a simple language easy to learn for beginners. Sorry, in the age where software runs the world and AI is leading the charge, that reason does not hold water because safety must trump ease of learning. Fortunately, maybe the Python community is learning...
A recent article explores Python type hints which at least allow developers to slowly add typing to Python programs without breaking existing code. See the article here: Why Today’s Python Developers Are Embracing Type Hints | Pyrefly
My Corner of the Web