Skip to content

isinstance

const isinstance: (obj: unknown, classInfo: unknown) => boolean = builtins.isinstance

Defined in: packages/pythonlib/src/index.ts:187

Return True if the object is an instance of the specified class.

Supports JavaScript constructors (Number, String, etc.) and Python type names.

Parameters

ParameterTypeDescription
objunknownThe object to check
classInfounknownThe class or type name to check against

Returns

boolean

True if obj is an instance of classInfo

See

Python isinstance()