I shortly switched from the PyCharm IDE to VSCodium. In that process, I came across extensions that do type checking in Python, such as Pyright. Using these leads to detecting a bunch of "errors" in pommesispatch.
The explanation is given by the workflow:
We initialize a DispatchModel object by setting its (major) attributes to None.
Then we overwrite these attributes with actual values from a config file. So they obviously are not of NoneType anymore.
Afterwards we perform operations on some attributes. The type checker now complains that these operations are not applicable for NoneType.
Here is my personal opinion on this one:
I don't think it is too bad since our workflow ensures that we do not run into NoneType values.
Of course it is not 100% clean since it defines a certain order of function calls (which is given in our model).
A possible solution could be to initialize empty / default value objects of the right type when initializing a DispatchModel. This would be kind of easy to do, I guess.
@hannesfelipe and @yannickwerner What do you think about this one?
I shortly switched from the PyCharm IDE to VSCodium. In that process, I came across extensions that do type checking in Python, such as Pyright. Using these leads to detecting a bunch of "errors" in
pommesispatch
.The explanation is given by the workflow:
Here is my personal opinion on this one:
A possible solution could be to initialize empty / default value objects of the right type when initializing a DispatchModel. This would be kind of easy to do, I guess.
@hannesfelipe and @yannickwerner What do you think about this one?