HackerRank Binary search tree validation
The prev_val handling is slightly clumsy.  I would personally prefer using the pairwise() recipe from itertools.  You could then replace the loop altogether with all(…), which more clearly expresses your intentions.

I would also prefer to see the generator yield node.data instead of yield node.

from itertools import tee

def checkBST(root):
    a_iter, b_iter = tee(in_order_traversal(root))
    next(b_iter, None)
    return all(a &lt;= b for a, b in zip(a_iter, b_iter))

def in_order_traversal(node):
    if node.left:
        yield from in_order_sort(node.left)
    yield node.data
    if node.right:
        yield from in_order_sort(node.right)