Skip to content

Commit

Permalink
deploy: 0f5e573
Browse files Browse the repository at this point in the history
  • Loading branch information
wesselb committed Jun 28, 2024
1 parent 258c1dc commit 0509ce8
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 26 deletions.
4 changes: 2 additions & 2 deletions _modules/plum/signature.html
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ <h1>Source code for plum.signature</h1><div class="highlight"><pre>
<span class="kn">from</span> <span class="nn">.repr</span> <span class="kn">import</span> <span class="n">repr_short</span><span class="p">,</span> <span class="n">rich_repr</span>
<span class="kn">from</span> <span class="nn">.type</span> <span class="kn">import</span> <span class="n">is_faithful</span><span class="p">,</span> <span class="n">resolve_type_hint</span>
<span class="kn">from</span> <span class="nn">.typing</span> <span class="kn">import</span> <span class="n">get_type_hints</span>
<span class="kn">from</span> <span class="nn">.util</span> <span class="kn">import</span> <span class="n">Comparable</span><span class="p">,</span> <span class="n">Missing</span><span class="p">,</span> <span class="n">TypeHint</span><span class="p">,</span> <span class="n">multihash</span><span class="p">,</span> <span class="n">wrap_lambda</span>
<span class="kn">from</span> <span class="nn">.util</span> <span class="kn">import</span> <span class="n">Comparable</span><span class="p">,</span> <span class="n">Missing</span><span class="p">,</span> <span class="n">TypeHint</span><span class="p">,</span> <span class="n">wrap_lambda</span>

<span class="n">__all__</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;Signature&quot;</span><span class="p">,</span> <span class="s2">&quot;append_default_args&quot;</span><span class="p">]</span>

Expand Down Expand Up @@ -469,7 +469,7 @@ <h1>Source code for plum.signature</h1><div class="highlight"><pre>
<span class="k">return</span> <span class="kc">False</span>

<span class="k">def</span> <span class="fm">__hash__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="n">multihash</span><span class="p">(</span><span class="n">Signature</span><span class="p">,</span> <span class="o">*</span><span class="bp">self</span><span class="o">.</span><span class="n">types</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">varargs</span><span class="p">)</span>
<span class="k">return</span> <span class="nb">hash</span><span class="p">((</span><span class="n">Signature</span><span class="p">,</span> <span class="o">*</span><span class="bp">self</span><span class="o">.</span><span class="n">types</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">varargs</span><span class="p">))</span>

<div class="viewcode-block" id="Signature.expand_varargs"><a class="viewcode-back" href="../../api.html#plum.signature.Signature.expand_varargs">[docs]</a> <span class="k">def</span> <span class="nf">expand_varargs</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">n</span><span class="p">:</span> <span class="nb">int</span><span class="p">)</span> <span class="o">-&gt;</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="w"> </span><span class="sd">&quot;&quot;&quot;Expand variable arguments.</span>
Expand Down
14 changes: 10 additions & 4 deletions _modules/plum/util.html
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,8 @@ <h1></h1>
<h1>Source code for plum.util</h1><div class="highlight"><pre>
<span></span><span class="kn">import</span> <span class="nn">abc</span>
<span class="kn">import</span> <span class="nn">sys</span>
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">List</span><span class="p">,</span> <span class="n">Sequence</span>
<span class="kn">import</span> <span class="nn">warnings</span>
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Hashable</span><span class="p">,</span> <span class="n">List</span><span class="p">,</span> <span class="n">Sequence</span>

<span class="k">if</span> <span class="n">sys</span><span class="o">.</span><span class="n">version_info</span><span class="o">.</span><span class="n">minor</span> <span class="o">&lt;=</span> <span class="mi">8</span><span class="p">:</span> <span class="c1"># pragma: specific no cover 3.9 3.10 3.11</span>
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Callable</span>
Expand All @@ -349,7 +350,6 @@ <h1>Source code for plum.util</h1><div class="highlight"><pre>
<span class="s2">&quot;Callable&quot;</span><span class="p">,</span>
<span class="s2">&quot;TypeHint&quot;</span><span class="p">,</span>
<span class="s2">&quot;Missing&quot;</span><span class="p">,</span>
<span class="s2">&quot;multihash&quot;</span><span class="p">,</span>
<span class="s2">&quot;Comparable&quot;</span><span class="p">,</span>
<span class="s2">&quot;wrap_lambda&quot;</span><span class="p">,</span>
<span class="s2">&quot;is_in_class&quot;</span><span class="p">,</span>
Expand Down Expand Up @@ -385,7 +385,7 @@ <h1>Source code for plum.util</h1><div class="highlight"><pre>
<span class="k">raise</span> <span class="ne">TypeError</span><span class="p">(</span><span class="s2">&quot;`Missing` cannot be instantiated.&quot;</span><span class="p">)</span></div>


<div class="viewcode-block" id="multihash"><a class="viewcode-back" href="../../api.html#plum.util.multihash">[docs]</a><span class="k">def</span> <span class="nf">multihash</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">multihash</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">:</span> <span class="n">Hashable</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">int</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Multi-argument order-sensitive hash.</span>

<span class="sd"> Args:</span>
Expand All @@ -394,7 +394,13 @@ <h1>Source code for plum.util</h1><div class="highlight"><pre>
<span class="sd"> Returns:</span>
<span class="sd"> int: Hash.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="nb">hash</span><span class="p">(</span><span class="n">args</span><span class="p">)</span></div>
<span class="n">warnings</span><span class="o">.</span><span class="n">warn</span><span class="p">(</span>
<span class="s2">&quot;The function `multihash` is deprecated and will be removed in a future &quot;</span>
<span class="s2">&quot;version. Please use `hash(tuple(*args))` instead.&quot;</span><span class="p">,</span>
<span class="ne">DeprecationWarning</span><span class="p">,</span>
<span class="n">stacklevel</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span>
<span class="p">)</span>
<span class="k">return</span> <span class="nb">hash</span><span class="p">(</span><span class="n">args</span><span class="p">)</span>


<div class="viewcode-block" id="Comparable"><a class="viewcode-back" href="../../api.html#plum.util.Comparable">[docs]</a><span class="k">class</span> <span class="nc">Comparable</span><span class="p">(</span><span class="n">metaclass</span><span class="o">=</span><span class="n">abc</span><span class="o">.</span><span class="n">ABCMeta</span><span class="p">):</span>
Expand Down
17 changes: 0 additions & 17 deletions api.html
Original file line number Diff line number Diff line change
Expand Up @@ -1592,23 +1592,6 @@ <h1>Application Programming Interface<a class="headerlink" href="#application-pr
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="plum.util.multihash">
<span class="sig-prename descclassname"><span class="pre">plum.util.</span></span><span class="sig-name descname"><span class="pre">multihash</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">args</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/plum/util.html#multihash"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#plum.util.multihash" title="Permalink to this definition">#</a></dt>
<dd><p>Multi-argument order-sensitive hash.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>*args</strong> – Objects to hash.</p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Hash.</p>
</dd>
<dt class="field-odd">Return type<span class="colon">:</span></dt>
<dd class="field-odd"><p>int</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="plum.util.wrap_lambda">
<span class="sig-prename descclassname"><span class="pre">plum.util.</span></span><span class="sig-name descname"><span class="pre">wrap_lambda</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">f</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Callable</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/util.html#wrap_lambda"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#plum.util.wrap_lambda" title="Permalink to this definition">#</a></dt>
Expand Down
2 changes: 0 additions & 2 deletions genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -556,8 +556,6 @@ <h2 id="M">M</h2>
<li><a href="api.html#plum.type.ModuleType">ModuleType (class in plum.type)</a>
</li>
<li><a href="api.html#plum.dispatcher.Dispatcher.multi">multi() (plum.dispatcher.Dispatcher method)</a>
</li>
<li><a href="api.html#plum.util.multihash">multihash() (in module plum.util)</a>
</li>
</ul></td>
</tr></table>
Expand Down
Binary file modified objects.inv
Binary file not shown.
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

0 comments on commit 0509ce8

Please sign in to comment.