Alir3z4 / html2text

Convert HTML to Markdown-formatted text.
alir3z4.github.io/html2text/
GNU General Public License v3.0
1.76k stars 270 forks source link

Expand use of dict get method to simplify code #327

Open equaeghe opened 4 years ago

equaeghe commented 4 years ago

In the code, there was often both a check for whether a certain key was in a dict and a conditional access of the corresponding value. This can be elegantly combined in a single call to the dict get method, whose default value if the key is not in the dict is None. Using the get method instead of the check and conditional access makes it possible to simplify the code in various places. This is done so in this patch.

coveralls commented 4 years ago

Coverage Status

Coverage decreased (-0.01%) to 97.868% when pulling bafb96e3e8daf92796e72ba624097815e16fe2cc on equaeghe:equaeghe-patch-1 into 24aac8629f6a50ab262727815107384e0682cf42 on Alir3z4:master.