Skip to content

Commit 5234d12

Browse files
committed
remove aside field from class variable text
1 parent 22d3c40 commit 5234d12

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

classes-objects.ipynb

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@
182182
"```\n",
183183
"\n",
184184
"::: {.content-visible when-format=\"html\"}\n",
185-
"::: aside \n",
186185
"Class variables can get a bit confusing; if you modify the variable associated with an object, it becomes an instance variable. For example:\n",
187186
"\n",
188187
"```python\n",
@@ -215,20 +214,25 @@
215214
"print(p1.spin)\n",
216215
"print(p2.spin)\n",
217216
"```\n",
218-
"gives\n",
217+
"giving\n",
218+
"```\n",
219219
"0.5\n",
220220
"0\n",
221-
"However, in general spin is still a class variable, and we can modify it for the whole class:\n",
221+
"```\n",
222+
"\n",
223+
"However, in general `spin` is still a class variable, and we can modify it for the whole class:\n",
224+
"```python\n",
222225
"Particle.spin = -0.5\n",
223226
"print(p1.spin)\n",
224227
"print(p2.spin)\n",
228+
"```\n",
225229
"which gives\n",
230+
"```\n",
226231
"0.5\n",
227232
"-0.5\n",
228-
"So for p1, spin has become an instance variable, but p2 is still pointing to the class variable.\n",
229233
"```\n",
230234
"\n",
231-
":::\n",
235+
"So, for `p1`, spin has become an instance variable, but `p2` still points to the class variable.\n",
232236
":::\n",
233237
"\n",
234238
"## Instance variables\n",

0 commit comments

Comments
 (0)