I don't like typing mainly because any code with it looks ugly XD, and if I really care about typing, I would use a different language.
Now we are pushing all languages to be able the same. Instead of having a few languages excel in different domain, we want to use one language to do everything. Each of them will come with their own eco-system, and we use library for every little simple things, then we have hundreds of dependency resolution solutions, I personally don't find it appealing.
There are programming languages better than Python on something, maybe don't use Python for something it is not good at.
to be clear, I am not against having static typing as option
My take was that Python's lack of static type checking led to the script being an unmaintainable mess because it was risky to refactor and gradually made impossible to audit, to the point where around 30% of its code was dead code that no one was able to spot.
Adding type checks was the key to fix that.
This anecdote feels like the norm in Python projects that fail to use static type checks. Without type hints, you are forced to manually check all code paths that directly and indirectly touch the component you need to change in order to reason if a minor change has catastrophic consequences. With static type checks, instead you only need to look at the type declaration or function signature to determine what you and cannot do. I don't understand how some Pythonista still try to pass this off as a feature instead of a fundamental problem.
It operated on two similar, but differently structured JSON files that described versions, deployments etc. One for libs and one for apps.
My initial goal was to use Pydantic to replace that untyped dict being used everywhere with a known type, simply to make the code easier to read.
So in my first pass, I simply added types to functions. Then I started replacing usages of dicts direct from JSON with Pydantic classes.
Which showed me that there were many functions that expected to operate on both libs and services, but some that operated only on one or the other, e.g., using dict keys that the other lib would never have.
But the real kicker was when I was approaching the end of this, thanks to the types, I could now see that no code paths for the service data actually led to it being persisted out into JSON again.
Any such path had been deleted in the past, but again, everyone was too scared to be bolder in their refactoring.
So adding types to the code made it far easier to reason about, and now I can delete about 500 lines in confidence.
That said, types aren't really needed for a 20 line Python script to "automate a common task without continually referring to the Bash docs".