Lines Matching refs:cls
36 def my_abstract_classmethod(cls, ...):
106 cls = super().__new__(mcls, name, bases, namespace, **kwargs)
107 _abc_init(cls)
108 return cls
110 def register(cls, subclass):
115 return _abc_register(cls, subclass)
117 def __instancecheck__(cls, instance):
118 """Override for isinstance(instance, cls)."""
119 return _abc_instancecheck(cls, instance)
121 def __subclasscheck__(cls, subclass):
122 """Override for issubclass(subclass, cls)."""
123 return _abc_subclasscheck(cls, subclass)
125 def _dump_registry(cls, file=None):
127 print(f"Class: {cls.__module__}.{cls.__qualname__}", file=file)
130 _abc_negative_cache_version) = _get_dump(cls)
137 def _abc_registry_clear(cls):
139 _reset_registry(cls)
141 def _abc_caches_clear(cls):
143 _reset_caches(cls)
146 def update_abstractmethods(cls):
158 Returns cls, to allow usage as a class decorator.
160 If cls is not an instance of ABCMeta, does nothing.
162 if not hasattr(cls, '__abstractmethods__'):
163 # We check for __abstractmethods__ here because cls might by a C
166 return cls
171 for scls in cls.__bases__:
173 value = getattr(cls, name, None)
177 for name, value in cls.__dict__.items():
180 cls.__abstractmethods__ = frozenset(abstracts)
181 return cls