Skip to content

Commit

Permalink
deploy: 218e875
Browse files Browse the repository at this point in the history
  • Loading branch information
wesselb committed Jun 28, 2024
1 parent 0509ce8 commit d62ca63
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions _modules/plum/dispatcher.html
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,9 @@ <h1>Source code for plum.dispatcher</h1><div class="highlight"><pre>
<span class="c1"># set the signature argument to `None`.</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_add_method</span><span class="p">(</span><span class="n">method</span><span class="p">,</span> <span class="kc">None</span><span class="p">,</span> <span class="n">precedence</span><span class="o">=</span><span class="n">precedence</span><span class="p">)</span>

<div class="viewcode-block" id="Dispatcher.multi"><a class="viewcode-back" href="../../api.html#plum.dispatcher.Dispatcher.multi">[docs]</a> <span class="k">def</span> <span class="nf">multi</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">signatures</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="n">Signature</span><span class="p">,</span> <span class="n">Tuple</span><span class="p">[</span><span class="n">TypeHint</span><span class="p">,</span> <span class="o">...</span><span class="p">]])</span> <span class="o">-&gt;</span> <span class="n">Callable</span><span class="p">:</span>
<div class="viewcode-block" id="Dispatcher.multi"><a class="viewcode-back" href="../../api.html#plum.dispatcher.Dispatcher.multi">[docs]</a> <span class="k">def</span> <span class="nf">multi</span><span class="p">(</span>
<span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">signatures</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="n">Signature</span><span class="p">,</span> <span class="n">Tuple</span><span class="p">[</span><span class="n">TypeHint</span><span class="p">,</span> <span class="o">...</span><span class="p">]]</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Callable</span><span class="p">[[</span><span class="n">Callable</span><span class="p">],</span> <span class="n">Function</span><span class="p">]:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Decorator to register multiple signatures at once.</span>

<span class="sd"> Args:</span>
Expand All @@ -425,7 +427,7 @@ <h1>Source code for plum.dispatcher</h1><div class="highlight"><pre>
<span class="sa">f</span><span class="s2">&quot;`plum.signature.Signature`.&quot;</span>
<span class="p">)</span>

<span class="k">def</span> <span class="nf">decorator</span><span class="p">(</span><span class="n">method</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">decorator</span><span class="p">(</span><span class="n">method</span><span class="p">:</span> <span class="n">Callable</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Function</span><span class="p">:</span>
<span class="c1"># The precedence will not be used, so we can safely set it to `None`.</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_add_method</span><span class="p">(</span><span class="n">method</span><span class="p">,</span> <span class="o">*</span><span class="n">resolved_signatures</span><span class="p">,</span> <span class="n">precedence</span><span class="o">=</span><span class="kc">None</span><span class="p">)</span>

Expand Down
2 changes: 1 addition & 1 deletion api.html
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ <h1>Application Programming Interface<a class="headerlink" href="#application-pr

<dl class="py method">
<dt class="sig sig-object py" id="plum.dispatcher.Dispatcher.multi">
<span class="sig-name descname"><span class="pre">multi</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">signatures</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Union</span><span class="p"><span class="pre">[</span></span><a class="reference internal" href="#plum.signature.Signature" title="plum.signature.Signature"><span class="pre">Signature</span></a><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">Tuple</span><span class="p"><span class="pre">[</span></span><span class="pre">object</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="p"><span class="pre">...</span></span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Callable</span></span></span><a class="reference internal" href="_modules/plum/dispatcher.html#Dispatcher.multi"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#plum.dispatcher.Dispatcher.multi" title="Permalink to this definition">#</a></dt>
<span class="sig-name descname"><span class="pre">multi</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">signatures</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Union</span><span class="p"><span class="pre">[</span></span><a class="reference internal" href="#plum.signature.Signature" title="plum.signature.Signature"><span class="pre">Signature</span></a><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">Tuple</span><span class="p"><span class="pre">[</span></span><span class="pre">object</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="p"><span class="pre">...</span></span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Callable</span><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">[</span></span><span class="pre">Callable</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><a class="reference internal" href="#plum.function.Function" title="plum.function.Function"><span class="pre">Function</span></a><span class="p"><span class="pre">]</span></span></span></span><a class="reference internal" href="_modules/plum/dispatcher.html#Dispatcher.multi"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#plum.dispatcher.Dispatcher.multi" title="Permalink to this definition">#</a></dt>
<dd><p>Decorator to register multiple signatures at once.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
Expand Down

0 comments on commit d62ca63

Please sign in to comment.