In reply to sages:
Since you have overriden, the object would be of type B. That is correct.
But, the handle is of the type A. This would restrict the access to constraints in class A alone and not B.
If you are sure that all the time you would be using class B, then you can change the handle to B type itself. If not, then it does not make sense to switch off constraint in B, when the object is of A. This would cause some confusion in the tool implementation. Hence, they have made sure that, to access constraints the handle should be of the same type.
Hope this cleared some of your confusion.