Skip to content

Commit a9549d2

Browse files
committed
New
1 parent 9b93f84 commit a9549d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,8 +1476,8 @@ class MyMetaClass(type):
14761476
return type.__new__(cls, name, parents, attrs)
14771477
```
14781478
* **New() is a class method that gets called before init(). If it returns an instance of its class, then that instance gets passed to init() as a 'self' argument.**
1479-
* **It receives the same arguments as init(), except for the first one that specifies the desired class of returned instance ('MyMetaClass' in our case).**
1480-
* **New() can also be called directly, usually from a new() method of a child class (`def __new__(cls): return super().__new__(cls)`), in which case init() is not called.**
1479+
* **It receives the same arguments as init(), except for the first one that specifies the desired class of returned instance (**`MyMetaClass`** in our case).**
1480+
* **New() can also be called directly, usually from a new() method of a child class (**`def __new__(cls): return super().__new__(cls)`**), in which case init() is not called.**
14811481

14821482
### Metaclass Attribute
14831483
**When class is created it checks if it has metaclass defined. If not, it recursively checks if any of his parents has it defined and eventually comes to type.**

0 commit comments

Comments
 (0)