def descendents(self, type=None):
    'Faster and more efficient dependency graph traversal\n\n            Requires Maya 2017+\n\n            Example:\n                >>> grandparent = createNode("transform")\n                >>> parent = createNode("transform", parent=grandparent)\n                >>> child = createNode("transform", parent=parent)\n                >>> mesh = createNode("mesh", parent=child)\n                >>> it = grandparent.descendents(type=tMesh)\n                >>> next(it) == mesh\n                True\n                >>> next(it)\n                Traceback (most recent call last):\n                ...\n                StopIteration\n\n            '
    type = (type or om.MFn.kInvalid)
    typeName = None
    if isinstance(type, string_types):
        typeName = type
        type = om.MFn.kInvalid
    it = om.MItDag(om.MItDag.kDepthFirst, om.MFn.kInvalid)
    it.reset(self._mobject, om.MItDag.kDepthFirst, om.MIteratorType.kMObject)
    it.next()
    while (not it.isDone()):
        mobj = it.currentItem()
        node = DagNode(mobj)
        if (typeName is None):
            if ((not type) or (type == node._fn.typeId)):
                (yield node)
        elif ((not typeName) or (typeName == node._fn.typeName)):
            (yield node)
        it.next()
Faster and more efficient dependency graph traversal

Requires Maya 2017+

Example:
    >>> grandparent = createNode("transform")
    >>> parent = createNode("transform", parent=grandparent)
    >>> child = createNode("transform", parent=parent)
    >>> mesh = createNode("mesh", parent=child)
    >>> it = grandparent.descendents(type=tMesh)
    >>> next(it) == mesh
    True
    >>> next(it)
    Traceback (most recent call last):
    ...
    StopIteration
def descendents(self, type=None):
    'Faster and more efficient dependency graph traversal\n\n            Requires Maya 2017+\n\n            Example:\n                >>> grandparent = createNode("transform")\n                >>> parent = createNode("transform", parent=grandparent)\n                >>> child = createNode("transform", parent=parent)\n                >>> mesh = createNode("mesh", parent=child)\n                >>> it = grandparent.descendents(type=tMesh)\n                >>> next(it) == mesh\n                True\n                >>> next(it)\n                Traceback (most recent call last):\n                ...\n                StopIteration\n\n            '
    type = (type or om.MFn.kInvalid)
    typeName = None
    if isinstance(type, string_types):
        typeName = type
        type = om.MFn.kInvalid
    it = om.MItDag(om.MItDag.kDepthFirst, om.MFn.kInvalid)
    it.reset(self._mobject, om.MItDag.kDepthFirst, om.MIteratorType.kMObject)
    it.next()
    while (not it.isDone()):
        mobj = it.currentItem()
        node = DagNode(mobj)
        if (typeName is None):
            if ((not type) or (type == node._fn.typeId)):
                (yield node)
        elif ((not typeName) or (typeName == node._fn.typeName)):
            (yield node)
        it.next()