MCPcopy Create free account
hub / github.com/BasisResearch/lean.py / __instancecheck__

Method __instancecheck__

lean_py/marshal.py:206–212  ·  view source on GitHub ↗
(cls, instance)

Source from the content-addressed store, hash-verified

204 return LeanInductiveValue(cls._type_name, cls._ctor_name, cls._tag, converted)
205
206 def __instancecheck__(cls, instance):
207 if isinstance(instance, LeanInductiveValue):
208 return instance.ctor == cls._ctor_name and instance._type_name == cls._type_name
209 if type(instance) is _CtorMeta:
210 # Allow isinstance(Color.red, Color.red) — both are _CtorMeta classes
211 return instance._ctor_name == cls._ctor_name and instance._type_name == cls._type_name
212 return False
213
214 def __repr__(cls):
215 return f"{cls._type_name}.{cls._ctor_name}"

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected