That is all coded in C++, i.e. the Lens
class is internally a C++ class and all the other classes are also C++ classes which overload the C++ Lens
class.
If you overload such Python-wrapped class and pass that object down to some C++ code again, the C++ code wont recognize the Python overwriting.
You might be able to write a C++ Lens
superclass which is able to do that, i.e. which implements all possible virtual functions and in all cases, always looks up wether there is a related Python object attribute which can be called. Note that this is likely to be slow.
In C++, you find the definition of Lens
here and here.
Take a look at the FisheyeLens
here to see what functions you have to overwrite from Lens
.