def _get_alphabetical_members(obj, predicate):
    """Get members of an object, sorted alphabetically.

    Parameters
    ----------
    obj
        An object.
    predicate : callable
        Callable that takes an attribute and returns a bool of whether the
        attribute should be returned or not.

    Returns
    -------
    members : `dict`
        Dictionary of

        - Keys: attribute name
        - Values: attribute

        The dictionary is ordered according to the attribute name.

    Notes
    -----
    This uses the insertion-order-preserved nature of `dict` in Python 3.6+.

    See also
    --------
    `inspect.getmembers`
    """
    fields = dict(inspect.getmembers(obj, predicate))
    keys = list(fields.keys())
    keys.sort()
    return {k: fields[k] for k in keys}
Get members of an object, sorted alphabetically.

    Parameters
    ----------
    obj
        An object.
    predicate : callable
        Callable that takes an attribute and returns a bool of whether the
        attribute should be returned or not.

    Returns
    -------
    members : `dict`
        Dictionary of

        - Keys: attribute name
        - Values: attribute

        The dictionary is ordered according to the attribute name.

    Notes
    -----
    This uses the insertion-order-preserved nature of `dict` in Python 3.6+.

    See also
    --------
    `inspect.getmembers`