[reportlab-users] Two Generic Questions

Tim Roberts timr at probo.com
Tue Oct 30 14:49:09 EDT 2007


Rich Shepard wrote:

> Without intending criticism or anything other than satisfying my

> curiosity, I'd like to understand why 1) we don't import everything from

> reportlab, but one function at a time.


That's just good Python practice. Almost any time you see this:

from anothermodule import *

it is a bad practice. It pollutes your global namespace with a whole
bunch of names that aren't visible to other people reading your code.
Later on, when the code says:

myCanvas = Canvas( ... )

The person reading your code says "where the heck did Canvas come
from?" Whereas, if it says this:

from reportlab.canvas import Canvas

then it is immediately clear where it came from.

--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the reportlab-users mailing list