mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
#17380: Document tp_init return value in extending docs.
Patch by James Powell.
This commit is contained in:
parent
9575e1891f
commit
354c7403c5
1 changed files with 2 additions and 1 deletions
|
|
@ -383,7 +383,8 @@ is used to initialize an object after it's created. Unlike the new method, we
|
|||
can't guarantee that the initializer is called. The initializer isn't called
|
||||
when unpickling objects and it can be overridden. Our initializer accepts
|
||||
arguments to provide initial values for our instance. Initializers always accept
|
||||
positional and keyword arguments.
|
||||
positional and keyword arguments. Initializers should return either 0 on
|
||||
success or -1 on error.
|
||||
|
||||
Initializers can be called multiple times. Anyone can call the :meth:`__init__`
|
||||
method on our objects. For this reason, we have to be extra careful when
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue