Skip to content

Commit 2c4cd28

Browse files
committed
Merge branch 'issue/7'
2 parents ec05456 + bf9e43b commit 2c4cd28

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

notebooks/PythonObjects.ipynb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1308,9 +1308,12 @@
13081308
"\n",
13091309
"- also called anti-pattern because there is only one instance of the class\n",
13101310
"- use `__new__()` method to create a new instance of the class\n",
1311+
"_ `__new__()` is a class method that is called before the `__init__()` instance method\n",
13111312
"- use `cls` parameter to check if the instance is already created\n",
13121313
"- return the instance if it's already created\n",
1313-
"- otherwise, create a new instance and return it"
1314+
"- otherwise, create a new instance and return it\n",
1315+
"- `__new__()` method takes the `cls` as the first argument\n",
1316+
" - also takes the rest of the arguments that are passed to the `__init__` method"
13141317
]
13151318
},
13161319
{

0 commit comments

Comments
 (0)