def rproperty(fget=None, fset=None, doc=None, readonly=False, writeonly=False):
    """
    Creates and returns a new property based on the input parameters.

    :param function fget: Function to be called for the new property's getter
    :param function fset: Function to be called for the new property's setter
    :param str doc: Docstring for the new property
    :param bool readonly: If `True`, the returned property does not have a
        setter.
    :param bool writeonly: If `True`, the returned property does not have a
        getter. Both readonly and writeonly cannot both be `True`.
    """
    if readonly and writeonly:
        raise ValueError('Properties cannot be both read- and write-only.')
    if readonly:
        return property(fget=fget, fset=None, doc=doc)
    elif writeonly:
        return property(fget=None, fset=fset, doc=doc)
    return property(fget=fget, fset=fset, doc=doc)
