Classes
Table of Contents
__new__
vs __init__
discussion
__init__
is called after the instance has been created (by__new__
), but before it is returned to the caller.- In general, you shouldn't need to override
__new__
unless you're subclassing an immutable type likestr
,int
,unicode
ortuple
.