Lines Matching refs:subclass
105 def register(cls, subclass): argument
107 if not isinstance(subclass, (type, types.ClassType)):
109 if issubclass(subclass, cls):
113 if issubclass(cls, subclass):
116 cls._abc_registry.add(subclass)
131 subclass = getattr(instance, '__class__', None)
132 if subclass is not None and subclass in cls._abc_cache:
137 subtype = subclass
138 if subtype is subclass or subclass is None:
145 return (cls.__subclasscheck__(subclass) or
148 def __subclasscheck__(cls, subclass): argument
151 if subclass in cls._abc_cache:
158 elif subclass in cls._abc_negative_cache:
161 ok = cls.__subclasshook__(subclass)
165 cls._abc_cache.add(subclass)
167 cls._abc_negative_cache.add(subclass)
170 if cls in getattr(subclass, '__mro__', ()):
171 cls._abc_cache.add(subclass)
175 if issubclass(subclass, rcls):
176 cls._abc_cache.add(subclass)
180 if issubclass(subclass, scls):
181 cls._abc_cache.add(subclass)
184 cls._abc_negative_cache.add(subclass)