You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2016-04-03.10:35:01.673>created_at=<Date2016-03-04.13:14:18.679>labels= ['invalid', 'docs']
title='Init documentation typo "may be return" > "may NOT be returned"'updated_at=<Date2016-04-03.10:35:01.672>user='https://github.com/samuelcolvin'
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.
>>> classC():
... def__init__(self): return42
...
>>>
>>> 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.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: