Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e6d3abd

Browse files
committed
Merge: #17380: Document tp_init return value in extending docs.
2 parents e81a773 + 354c740 commit e6d3abd

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Doc/extending/newtypes.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,8 @@ is used to initialize an object after it's created. Unlike the new method, we
383383
can't guarantee that the initializer is called. The initializer isn't called
384384
when unpickling objects and it can be overridden. Our initializer accepts
385385
arguments to provide initial values for our instance. Initializers always accept
386-
positional and keyword arguments.
386+
positional and keyword arguments. Initializers should return either 0 on
387+
success or -1 on error.
387388

388389
Initializers can be called multiple times. Anyone can call the :meth:`__init__`
389390
method on our objects. For this reason, we have to be extra careful when

0 commit comments

Comments
 (0)