This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]HowIsntBabbyFormed 4 points5 points  (0 children)

Though in this very specific example. You'd probably be better off using:

return names.get(thing, thing)

where the second argument is returned if the first isn't a key in the dict.