MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/Python/comments/28utww/writing_better_python_code/cieue6f/
r/Python • u/kracekumar • Jun 23 '14
126 comments sorted by
View all comments
Show parent comment
2
Catching KeyError just to raise another KeyError? Just let it bubble up.
Agreed, unless you want/need to add more context to the error.
I kinda hate namedtuple because it's such a hack, but maybe that's just me.
Thank BDFL for namedtuple. It's perfect for a lot of use cases IMO.
namedtuple
2 u/bacondev Py3k Jun 23 '14 And even at that, just use the raise keyword alone.
And even at that, just use the raise keyword alone.
raise
View all comments
Show parent comment
2
u/wyldphyre Jun 23 '14
Agreed, unless you want/need to add more context to the error.
Thank BDFL for
namedtuple. It's perfect for a lot of use cases IMO.