| | | |
Offset 516, 15 lines modified | Offset 516, 15 lines modified |
516 | <span·class="gp">...·</span>····<span·class="k">for</span>·<span·class="n">e</span>·<span·class="ow">in</span>·<span·class="nb">sorted</span><span·class="p">(</span><span·class="n">errors</span><span·class="p">,</span>·<span·class="n">key</span><span·class="o">=</span><span·class="n">exceptions</span><span·class="o">.</span><span·class="n">relevance</span><span·class="p">)</span> | 516 | <span·class="gp">...·</span>····<span·class="k">for</span>·<span·class="n">e</span>·<span·class="ow">in</span>·<span·class="nb">sorted</span><span·class="p">(</span><span·class="n">errors</span><span·class="p">,</span>·<span·class="n">key</span><span·class="o">=</span><span·class="n">exceptions</span><span·class="o">.</span><span·class="n">relevance</span><span·class="p">)</span> |
517 | <span·class="gp">...·</span><span·class="p">]</span> | 517 | <span·class="gp">...·</span><span·class="p">]</span> |
518 | <span·class="go">['home',·'name']</span> | 518 | <span·class="go">['home',·'name']</span> |
519 | </pre></div> | 519 | </pre></div> |
520 | </div> | 520 | </div> |
521 | <dl·class="function"> | 521 | <dl·class="function"> |
522 | <dt·id="jsonschema.exceptions.by_relevance"> | 522 | <dt·id="jsonschema.exceptions.by_relevance"> |
523 | <code·class="descclassname">jsonschema.exceptions.</code><code·class="descname">by_relevance</code><span·class="sig-paren">(</span><em>weak=frozenset({'anyOf'</em>,·<em>'oneOf'})</em>,·<em>strong=frozenset()</em><span·class="sig-paren">)</span><a·class="reference·internal"·href="_modules/jsonschema/exceptions.html#by_relevance"><span·class="viewcode-link">[source]</span></a><a·class="headerlink"·href="#jsonschema.exceptions.by_relevance"·title="Permalink·to·this·definition">¶</a></dt> | 523 | <code·class="descclassname">jsonschema.exceptions.</code><code·class="descname">by_relevance</code><span·class="sig-paren">(</span><em>weak=frozenset({'oneOf'</em>,·<em>'anyOf'})</em>,·<em>strong=frozenset()</em><span·class="sig-paren">)</span><a·class="reference·internal"·href="_modules/jsonschema/exceptions.html#by_relevance"><span·class="viewcode-link">[source]</span></a><a·class="headerlink"·href="#jsonschema.exceptions.by_relevance"·title="Permalink·to·this·definition">¶</a></dt> |
524 | <dd><p>Create·a·key·function·that·can·be·used·to·sort·errors·by·relevance.</p> | 524 | <dd><p>Create·a·key·function·that·can·be·used·to·sort·errors·by·relevance.</p> |
525 | <table·class="docutils·field-list"·frame="void"·rules="none"> | 525 | <table·class="docutils·field-list"·frame="void"·rules="none"> |
526 | <col·class="field-name"·/> | 526 | <col·class="field-name"·/> |
527 | <col·class="field-body"·/> | 527 | <col·class="field-body"·/> |
528 | <tbody·valign="top"> | 528 | <tbody·valign="top"> |
529 | <tr·class="field-odd·field"><th·class="field-name">Parameters:</th><td·class="field-body"><ul·class="first·last·simple"> | 529 | <tr·class="field-odd·field"><th·class="field-name">Parameters:</th><td·class="field-body"><ul·class="first·last·simple"> |
530 | <li><strong>weak</strong>·(<em>set</em>)·–·a·collection·of·validator·names·to·consider·to | 530 | <li><strong>weak</strong>·(<em>set</em>)·–·a·collection·of·validator·names·to·consider·to |