from the reference documentation (emphasis mine):
ok, so you are saying that no one codes a return statement on __init__(). what if complicated logic can be coded simpler by having a return in nested conditionals?
Quote:Becauseit does not say, one way or the other, whether an explicit None or implicit None is the way to code this. indeed, a quick look at several classes i did not code show a predominance of implicit returns by having no return coded at all. it has been my general practice (with some exceptions) to code explicitly in the various languages i code in.__new__()
and__init__()
work together in constructing objects (__new__()
to create it, and__init__()
to customize it), no [u]non-None[/u]
value may be returned by__init__()
; doing so will cause aTypeError
to be raised at runtime.
ok, so you are saying that no one codes a return statement on __init__(). what if complicated logic can be coded simpler by having a return in nested conditionals?
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.