I am trying to understand why any class that has the __contains__ method becomes an instance of the Container abstract class. I am getting a little confused because the correct way should be like this class dumb(Container): and define your own __contains__ method.
It supposes to be because of duck typing but where is the duck typing there?
Classes are able to customize
isinstancechecks by implementing__subclasshook__. Many classes will choose to look at properties of the instance to determine the type rather than relying on the inheritance hierarchiesFor example, this is how Container is implemented