def rstrip(text, chars=None):
    """
    Creates a copy of ``text`` with trailing characters removed. 
    
    The ``chars`` argument is a string specifying the set of characters to be removed. If 
    omitted or None, the ``chars`` argument defaults to removing whitespace. The ``chars`` 
    argument is not a suffix; rather, all combinations of its values are stripped::
        
        >>>
        >>> rstrip('   spacious   ')
        '   spacious'
        >>> rstrip('mississippi','ipz')
        'mississ'
    
    :param text: The string to copy
    :type text:  ``str``
    
    :param chars: The trailing characters to remove
    :type chars:  ``str``
    
    :return: A copy of ``text`` with the trailing characters removed.
    :rtype:  ``str``
    """
    assert isinstance(text,str), '%s is not a string' % text
    return text.rstrip(chars)