def public_properties(obj, key=None):
    """
    List the public properties of an object, optionally filtered by a `key` function
    """
    props = [p for p in dir(obj) if p[0] is not '_']
    
    if key is not None:
        props = [p for p in props if key(p)]

    return props