Hi Ben,
There's a bit of duplication in the keys being looked up, making it a
bit fragile if you need to correct the spelling of a key or need to
add additional keys, since there are two places that need to be
changed.
One way to make this a little cleaner might be to have a helper
function that
Ben Sherman wrote:
> Whats a more pythony way to do this? I have a dict with a few dozen
> elements, and I want to pull a few out. I've already shortened it with
> itemgetter, but it still seems redundant. I feel like I can do something
> like I've seen with *kwargs, but I'm not sure.
>
> I'm
Whats a more pythony way to do this? I have a dict with a few dozen
elements, and I want to pull a few out. I've already shortened it with
itemgetter, but it still seems redundant. I feel like I can do something
like I've seen with *kwargs, but I'm not sure.
I'm using old style sprintf formatti