Tkinter layout manager methods

Hans-Joachim Widmaier hjwidmai at foxboro.com
Fri Aug 4 02:46:50 EDT 2000


[J. Clueless (me) asked about pack() and friends returning None]

Richard Brodie:
> Consistency with other operators I guess. For example, list.sort() doesn't
> return anything; neither are assignments expressions.

Not that I didn't fall in that trap, either.

> Button b = Button(text="Ok", command=self.ok).pack()
> 
> in a strongly typed language. Then it's clear that b ends up as an
> instance of Button.

I see ... Ok, it does make some sense.

> There is always the option of combining the statements on one line
> which, used sparingly, can make the code easier to follow.
> 
> e.g. b = Button(text="Ok", command=self.ok); b.pack()

Right, but 2 statements on one line are even worse. ;-)

> With-lines-200-characters-wide-you-can-fit-multiple-statements-on-
> one-line'ly-yours.

Never-wanted-to-write-extra-long-lines'ly-yours,

-- 
Hans-Joachim Widmaier




More information about the Python-list mailing list