def is_attribute(method, name=None):
    """
    Decorator for methods that are attributes.
    """
    if name is None:
        name = method.__name__
    method.is_attribute = True
    method.name = name
    return method