Skip to content

Resolve Python ambiguity for sequence objects

David Gobbi requested to merge dgobbi/vtk:python-resolve-ambiguity into master

VTK has some overloaded methods like the following:

void SetColor(const vtkColor4d& color);
void SetColor(const double color[4]);

Since vtkColor4d and similar objects can be indexed as sequences, they can satisfy both overloads. This fix penalizes the second overload, so that the first overload (the one that specifies the object type) is preferred. Without this fix, the wrappers report an overload resolution ambiguity and raise a TypeError.

Merge request reports