[reportlab-users] Many __repr__() methods are really __str__ methods

Andy Robinson reportlab-users@reportlab.com
Thu, 13 Feb 2003 13:20:52 -0000


> So your generated script is only working by accident. The way you need 
> to
> do this is to use pickle module, so your generated script would be made 
> up
> of lines like:
> 
> foo = pickle.loads('<thepickledobject>')
> 

There are good reasons for code generation sometimes,
but I can think of 2 better ways to do it:
(1) Jerome Alet's pycanvas, already checked into 
   reportlab/pdfgen/pycanvas.py
(2) writing an explicit bit of code to turn a
platypus template, stylesheets and story into
a code module.

Full "__repr__"oducibility is one way to implement
(2) but let's hear what Norman was actually trying
to do first...

- Andy