> what do you attribute to never finding a bug due to incorrect type?
If the function/method expects an int, string or complex type and I accidentally call it with the wrong type, resulting in an error, such as "can't add 1 to a string", or "can't access access that method because a string was passed".
>and what is good python vs bad python?
This is kinda of subjective but, for a start, don't just start at the type and do stuff until the bottom like a shell script. This is by far how I see most python scripts. All the other normal things. Don't repeat yourself (in moderation, a few times is OK). Keep it simple.
That is my point. I don't have any tools to prevent it from happening. I just don't do it when I write the code. If I have and my code is tested it comes up very quickly.
Us older people tend to keep the whole workflow as simple as possible. That is why I love python. There is very little overhead to just using it.
If you tend to make this mistake a lot it might make sense to add some tooling. I don't need it. If I wanted strict typing I would probably just use C++.
OK, it's 100% likely I saw it, just so rarely I can't remember.
Testing. Over that long time I have used many test frameworks. My normal workflow is to try and exercise all the code I write as I go.
On the other hand I am 100% pedantic about using 'schema' (https://pypi.org/project/schema/) to validate all the types, structure and domains when I read json.
Nearly the same here.
The only type error I make a little bit more than I would like, is expecting an iterable and passing a string instead, because I forgot parentheses around arguments.
But I made way more type errors when programming in C/++.
If the function/method expects an int, string or complex type and I accidentally call it with the wrong type, resulting in an error, such as "can't add 1 to a string", or "can't access access that method because a string was passed".
>and what is good python vs bad python?
This is kinda of subjective but, for a start, don't just start at the type and do stuff until the bottom like a shell script. This is by far how I see most python scripts. All the other normal things. Don't repeat yourself (in moderation, a few times is OK). Keep it simple.