Dictionaries ------------ From Pairs ++++++++++ .. tab:: ✅ Good .. literalinclude:: ../../_static/idioms/pairs.py :language: python3 :start-after: # Good :end-before: # Bad .. tab:: ❌ Bad .. literalinclude:: ../../_static/idioms/pairs.py :language: python3 :start-after: # Bad .. tab:: 🎭 Compare .. literalinclude:: ../../_static/idioms/pairs.py :language: python3 **💡 learnt from:** * Source: `Raymond Hettinger`_ * Reference: `Transform Python Slides`_ Count +++++ .. tab:: ✅ Good .. literalinclude:: ../../_static/idioms/count.py :language: python3 :start-after: # Good :end-before: # Bad .. tab:: ❌ Bad .. literalinclude:: ../../_static/idioms/count.py :language: python3 :start-after: # Bad .. tab:: 🎭 Compare .. literalinclude:: ../../_static/idioms/count.py :language: python3 Layering ++++++++ .. tab:: ✅ Good .. literalinclude:: ../../_static/idioms/layering.py :language: python3 :start-after: # Good :end-before: # Bad .. tab:: ❌ Bad .. literalinclude:: ../../_static/idioms/layering.py :language: python3 :start-after: # Bad .. tab:: 🎭 Compare .. literalinclude:: ../../_static/idioms/layering.py :language: python3 **💡 learnt from:** * Source: `Raymond Hettinger`_ * Reference: `Transform Python Slides`_ .. _Raymond Hettinger: https://github.com/rhettinger .. _Transform Code into Beautiful, Idiomatic Python: https://www.youtube.com/watch?v=OSGv2VnC0go> .. _Transform Python Slides: https://speakerdeck.com/pyconslides/transforming-code-into-beautiful-idiomatic-python-by-raymond-hettinger-1