Gurobi / gurobipy-stubs

MIT License
10 stars 2 forks source link

only int, float and str supported as indices to addVars #6

Closed mcolombi closed 2 years ago

mcolombi commented 2 years ago

It looks like while gurobipy allows for an Iterable of Hashable objects to be passed as index to addVars, the stubs only allow for an Iterable of _Scalar which is either int, str or float

etowle commented 2 years ago

Thanks for opening this issue. Unfortunately, in its current state, gurobipy is not guaranteed to properly handle arbitrary Hashable objects as variable indices, as this can cause issues with variable names or break helper methods like tupledict.sum.