__init__ not a "constructor" ?
Kirby Urner
urner at alumni.princeton.edu
Mon Aug 13 14:19:54 EDT 2001
I notice the author of the Dive Into Python tutorial cautions
that __init__ is not trully a class constructor, as by the time
it's invoked, an instance already exists (hence the argument
'self', hence the fact that classes don't need an __init__
method).
I'm wondering if it's therefore considered faux pax to refer to
the constructor of a Python user-defined class, meaning __init__,
or if there's some tacit liberalizing of "constructor" (it's meaning)
going on, such that this usage is acceptable.
Any feedback useful. CC: urner at alumni.princeton.edu please.
Kirby
PS: I should check the official Python docs to see if "constructor"
terminology is used. I'll do that next.
More information about the Python-list
mailing list