Skip to main content

contains

Return True if the "source" contains an instance of "inst". False, otherwise.

def contains(
source: object,
inst: type
) - > boolean

Return True if the "source" contains an instance of "inst". False, otherwise.

Parameters

NameTypeDescription
sourceobjectThe object or container to search through for the specified instance type
insttypeThe class or type to check for within the source structure

Returns

TypeDescription
booleanTrue if the source or any of its nested elements are an instance of the specified type, False otherwise