Skip to content

Commit 67a16d7

Browse files
committed
Added slots
1 parent c637f0f commit 67a16d7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ class <class_name>:
10361036
### Slots
10371037
**Mechanism that restricts objects to attributes listed in 'slots' and significantly reduces their memory footprint.**
10381038

1039-
```
1039+
```python
10401040
class MyClassWithSlots:
10411041
__slots__ = ['a']
10421042
def __init__(self):

index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ <h3 id="dataclass">Dataclass</h3>
976976
</ul>
977977
<h3 id="slots">Slots</h3>
978978
<p><strong>Mechanism that restricts objects to attributes listed in 'slots' and significantly reduces their memory footprint.</strong></p>
979-
<pre><code class="python hljs"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyClassWithSlots</span>:</span>
979+
<pre><code class="python language-python hljs"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyClassWithSlots</span>:</span>
980980
__slots__ = [<span class="hljs-string">'a'</span>]
981981
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">__init__</span><span class="hljs-params">(self)</span>:</span>
982982
self.a = <span class="hljs-number">1</span>

0 commit comments

Comments
 (0)