Browse Source

New

pull/28/head
Jure Šorn 5 years ago
parent
commit
98e473faa3
1 changed files with 1 additions and 1 deletions
  1. 2
      README.md

2
README.md

@ -1460,7 +1460,7 @@ class MyMetaClass(type):
attrs['a'] = 'abcde' attrs['a'] = 'abcde'
return type.__new__(cls, name, parents, attrs) return type.__new__(cls, name, parents, attrs)
``` ```
* **New() is a class method that gets called before init(). It returns an instance of a class that gets passed to init() as a 'self' argument.**
* **New() is a class method that gets called before init(). If it returns an instance of a class, then that instance gets passed to init() as a 'self' argument.**
* **It receives the same arguments as init(), except for the first one which is its class.** * **It receives the same arguments as init(), except for the first one which is its class.**
### Metaclass Attribute ### Metaclass Attribute

Loading…
Cancel
Save