File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff 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
10401040class MyClassWithSlots :
10411041 __slots__ = [' a' ]
10421042 def __init__ (self ):
Original file line number Diff line number Diff 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 >
You can’t perform that action at this time.
0 commit comments