cpython: c6dc1e0db7f0 (original) (raw)

Mercurial > cpython

changeset 95561:c6dc1e0db7f0 3.4

#17380: Document tp_init return value in extending docs. Patch by James Powell. [#17380]

R David Murray rdmurray@bitdance.com
date Sun, 12 Apr 2015 21:51:36 -0400
parents 6d5336a193cc
children d74ede4bbf81 89eb5d9f7541
files Doc/extending/newtypes.rst
diffstat 1 files changed, 2 insertions(+), 1 deletions(-)[+] [-] Doc/extending/newtypes.rst 3

line wrap: on

line diff

--- a/Doc/extending/newtypes.rst +++ b/Doc/extending/newtypes.rst @@ -383,7 +383,8 @@ is used to initialize an object after it 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