code class="code">i+1</code> or <code class="code">None</code> if <code class="code">c</code> does not
    occur in <code class="code">s</code> before position <code class="code">i+1</code>.  <code class="code">rindex_opt&nbsp;s&nbsp;c</code> is equivalent to
    <code class="code">rindex_from&nbsp;s&nbsp;(length&nbsp;s&nbsp;-&nbsp;1)&nbsp;c</code>.</p>
</div>
<ul class="info-attributes">
<li><b>Since</b> 4.05</li>
<li><b>Raises</b> <code>Invalid_argument</code> if <code class="code">i+1</code> is not a val