3 ms·
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()
by msbarnett 16y ago
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.
- guns 16y agoWell, that's another way to do it. ;)