[reportlab-users] wouldn't it be interesting...

Dinu Gherman reportlab-users@reportlab.com
Wed, 12 Feb 2003 17:59:33 +0100


Jerome Alet:

> Hi there,
>
> wouldn't it be interesting to make all canvas methods which
> currently return nothing (None) return self instead ?
> this would allow things like
>
> canvas.saveState().scale(0.5,0.5).drawString(10,10, 
> "Hello").restoreState()

Yes, it would save some nasty typing. I wonder why Python methods
return None, a totally useless value? Maybe for functions that
makes sense, but returning self as default value for methods would
be generally much closer to the natural thing that you want.

But who cares, anyway, if nowadays people argue about which of
the zillion ways of expressing if-statements should be added to
the language?

Dinu

--
Dinu C. Gherman
......................................................................
"Patriotism is the willingness to kill and be killed for trivial
reasons." (Bertrand Russell)