26 Jun
2013
26 Jun
'13
8:51 a.m.
Andrew Barnert wrote:
Notice that in this case, you don't actually need to pull out font and pass it along:
def __init__(self, text = "Hello", **kwds): default_size = calc_default_size(text, kwds.get('font', system_font)) Widget.__init__(self, size = default_size, **kwds)
That's what I ended up doing in many cases. But using get() with a constant name has something of a nasty whiff about it as well.
I think the issue isn't how many passed-on arguments you have, but how many you're peeking at.
Yes, that's what I meant. -- Greg