Simeon Visser added the comment:
Is it worth clarifying that __init__ can return a value but only the value
None? The following won't raise a TypeError:
class O(object):
def __init__(self):
return None
Admittedly the "return None" is the default behaviour but people may attempt
this in order to "block creation" of the instance (as __new__ is less
well-known, I have seen the above attempted on Stack Overflow:
http://stackoverflow.com/questions/26896941/proper-way-to-terminate-object-creation-inside-of-init/)
----------
nosy: +simeon.visser
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue20467>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com