I'm a big fan of the Python API. I especially like the tuplelist, that I use a lot to create the indices for the variables and constraints. I use PyCharm when coding in Python and I don't know if the following is specific to PyCharm, but when iterating over the elements in a tuplelist, I don't get any type hinting as when iterating over elements in a normal list:
As you can see in the picture, PyCharm has no knowledge of the types of the elements in the typelist. To handle this I have implemented a wrapper class that enherits from tuplelist and Generic, so I can get type hinting as you can see in the following images:
I find this very helpful when I create constraints and the elements are custom classes and I want to make some if statements, that needs to check for certain conditions on the object.
My question is: would it be possible to add something similar to your API, so other developers could benefit from it as well?
Please sign in to leave a comment.