Browse Source

Class

pull/135/head
Jure Šorn 2 years ago
parent
commit
16b2ca71a4
2 changed files with 2 additions and 2 deletions
  1. 2
      README.md
  2. 2
      index.html

2
README.md

@ -1012,7 +1012,7 @@ class B: pass
class C(A, B): pass
```
**MRO determines the order in which parent classes are traversed when searching for a method:**
**MRO determines the order in which parent classes are traversed when searching for a method or an attribute:**
```python
>>> C.mro()
[<class 'C'>, <class 'A'>, <class 'B'>, <class 'object'>]

2
index.html

@ -862,7 +862,7 @@ Z = dataclasses.make_dataclass(<span class="hljs-string">'Z'</span>, [<span clas
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">C</span><span class="hljs-params">(A, B)</span>:</span> <span class="hljs-keyword">pass</span>
</code></pre></div>
<p><strong>MRO determines the order in which parent classes are traversed when searching for a method:</strong></p>
<p><strong>MRO determines the order in which parent classes are traversed when searching for a method or an attribute:</strong></p>
<pre><code class="python language-python hljs"><span class="hljs-meta">&gt;&gt;&gt; </span>C.mro()
[&lt;<span class="hljs-class"><span class="hljs-title">class</span> '<span class="hljs-title">C</span>'&gt;, &lt;<span class="hljs-title">class</span> '<span class="hljs-title">A</span>'&gt;, &lt;<span class="hljs-title">class</span> '<span class="hljs-title">B</span>'&gt;, &lt;<span class="hljs-title">class</span> '<span class="hljs-title">object</span>'&gt;]
</span></code></pre>

Loading…
Cancel
Save