This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ronaldoussoren
Recipients docs@python, ronaldoussoren, samuelcolvin
Date 2016-03-04.13:23:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1457097795.53.0.448274692542.issue26479@psf.upfronthosting.co.za>
In-reply-to
Content
The text appears to be correct as it is. What is says is that __init__ must not return any value other than None and that is correct, you will get an exception when you return a value that is not None.

>>> class C():
...    def __init__(self): return 42
... 
>>> 
>>> C()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: __init__() should return None, not 'int'
>>> 

The text is basically a language-lawyer way of stating that __init__ should return by either running of the end of the method, or by using a bare return statement.
History
Date User Action Args
2016-03-04 13:23:15ronaldoussorensetrecipients: + ronaldoussoren, docs@python, samuelcolvin
2016-03-04 13:23:15ronaldoussorensetmessageid: <1457097795.53.0.448274692542.issue26479@psf.upfronthosting.co.za>
2016-03-04 13:23:15ronaldoussorenlinkissue26479 messages
2016-03-04 13:23:15ronaldoussorencreate