← Back to context

Comment by nickserv

2 years ago

Not sure I understand your point, there will always be runtime checks in any non-trivial application. Typically these will be for things outside of the code, for example: network status, file access, user input, external input (think JSON parsing), hardware requirements, etc

So for opening a file for example, using try/except instead of checking if the file exist and is readable first.

Both achieve the same results but the first is more "pythonic".

My point is that this way of writing code is not at all incompatible with using a type checker for said code.

>My point is that this way of writing code is not at all incompatible with using a type checker for said code.

I'm saying "incompatible" isn't even a relevant concept here. Here's an analogy:

You're telling me that running with shoes is compatible with running without shoes thus I can run with one shoe on one foot and the other foot is barefoot.

The goal is to objectively put shoes on both feet. Sometimes you're missing a shoe so you have no choice. But this has nothing to do with "compatibility" it's a completely different thing.

We are getting a bit into pedantic territory here, but THAT was my point and I am simply clarifying it because you MISSED the point.