Is it a valid search tree?

Write is_bst(root) that returns whether the tree satisfies the binary search tree rule everywhere: every value in a node's left subtree is strictly less than the node, every value in its right subtree strictly greater.

is_bst([2, 1, 3])                ->  True
is_bst([5, 1, 4, None, None, 3, 6])  ->  False    (3 is in the right subtree of 5)
is_bst(None)                     ->  True

The point is to practise passing allowed bounds down the recursion. Checking each node against only its children misses the second example.

def is_bst(root):
    ...