Skip to content

Commit 4095057

Browse files
committed
Comparable
1 parent 756bc55 commit 4095057

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,7 @@ Duck Types
874874
### Comparable
875875
* **If eq() method is not overridden, it returns `'id(self) == id(other)'`, which is the same as `'self is other'`.**
876876
* **That means all objects compare not equal by default.**
877-
* **Only object on the left side of a comparison has eq() called, unless it returns 'NotImplemented', in which case the right object is consulted.**
877+
* **Only left side object has eq() method called, unless it returns 'NotImplemented', in which case the right object is consulted.**
878878

879879
```python
880880
class MyComparable:

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ <h3 id="comparable">Comparable</h3>
779779
<ul>
780780
<li><strong>If eq() method is not overridden, it returns <code class="python hljs"><span class="hljs-string">'id(self) == id(other)'</span></code>, which is the same as <code class="python hljs"><span class="hljs-string">'self is other'</span></code>.</strong></li>
781781
<li><strong>That means all objects compare not equal by default.</strong></li>
782-
<li><strong>Only object on the left side of a comparison has eq() called, unless it returns 'NotImplemented', in which case the right object is consulted.</strong></li>
782+
<li><strong>Only left side object has eq() method called, unless it returns 'NotImplemented', in which case the right object is consulted.</strong></li>
783783
</ul>
784784
<pre><code class="python language-python hljs"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyComparable</span>:</span>
785785
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">__init__</span><span class="hljs-params">(self, a)</span>:</span>

0 commit comments

Comments
 (0)