Skip to content

Commit 0a5b6ba

Browse files
committed
Removed green color, comparable
1 parent fefd403 commit 0a5b6ba

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

README.md

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

872873
```python
873874
class MyComparable:

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,7 @@ <h3 id="comparable">Comparable</h3>
775775
<ul>
776776
<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>
777777
<li><strong>That means all objects compare not equal by default.</strong></li>
778+
<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>
778779
</ul>
779780
<pre><code class="python language-python hljs"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyComparable</span>:</span>
780781
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">__init__</span><span class="hljs-params">(self, a)</span>:</span>

web/default.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)