[reportlab-users] Basic BaseDocTemplate - len() of unsized object
Tim Roberts
timr at probo.com
Tue Jan 30 13:02:04 EST 2007
Riaan Bekker wrote:
> I just removed the "self" variable from the doc.build() function and the
> null error went away. Why does the function prototype indicate a SELF if it
> is not to be used ? Am I totally on the wrong track ?
>
This is a fundamental piece of Python. "self" is akin to the "this"
variable in C++. When you call a member function of a class
(doc.build()), there has to be a way to tell the function (build) which
object it is to work with (doc), so the function can access the member
variables and such. Python automatically passes that object as the
first parameter to the method. By convention, methods call that
parameter "self". YOU don't pass the "self" parameter; Python does it
for you.
So, when you do:
doc.build()
It is equivalent to:
coaDocTemplate.build( doc )
> Is this list still active ?
>
Why would you ask that? There have been 10 or 12 messages per day
recently. Are you not seeing them?
--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the reportlab-users
mailing list