fix(lint): resolve errors from merged PR #14#17
Conversation
|
Oh no. |
|
I'm getting back to this, and I see a lot of repeated and possibly superfluous lines of code. For example, this in the if not isinstance(queryString, str):
raise TypeError(
f"queryString must be a string, not {type(queryString).__name__}."
)However, the Python interpreter should be able to catch on to this, given the strict typing enforced in the function definition. I'm seeing this pattern throughout most methods in As for the repeated code, I see code being mirrored between |
|
Python is not statically-typed and the typing in the function definition are simply annotations that can be used by third-party programs such as language servers or optional static type checkers like mypy. The interpreter does not strictly enforce these typings at runtime, and will only raise exceptions further down when it runs into unexpected behavior. The relevant logic is to prevent things from ever getting to that stage and identifies exactly what is wrong (as opposed to perhaps a more confusing error later down), regardless if people are paying attention to the annotations or not. I don't think the repeated code is too much of a problem for now, as |
|
I completely forgot about that. I did get working on just moving the duplicated logic already to I'm going to try to get this fixed this soon, maybe sometime this week. |
See #8