def PaneSortFunc(p1, p2):
    """
    This function is used to sort panes by dock position.

    :param `p1`: the first pane instance to compare, an instance of :class:`AuiPaneInfo`;
    :param `p2`: the second pane instance to compare, an instance of :class:`AuiPaneInfo`.
    """
    return (p1.dock_pos < p2.dock_pos and [-1] or [1])[0]
