Re:Python idiom for taking the single item from a list
by guns on Monday September 27, 2010 @02:54PM
(#1732878)
Seems he would have more fun being a Rubyist.
[ Parent
| on HN ]
Re:Python idiom for taking the single item from a list
by msbarnett on Monday September 27, 2010 @05:33PM
(#1733531)
Funny, I was just thinking how much cleaner a supposedly-horrid monkey-patch would make his example in Ruby.
thing = some_dict[my_object.get_foobar_handler()].get_only_element()
self-documents the purpose of the operation and its assumption much more legibly than the typo-esque (thing,) = ...
in my opinion.