Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Zen of Python #DevCamp01

Zen of Python #DevCamp01

Présentation de la philosophie de développement du langage Python "Zen of Python - PEP 20" pour le premier DevCamp de Rennes à la Cantine Numérique Rennaise.

1e88e032d61a9343dca0a7fc9cccc7b4?s=128

Florian Strzelecki

October 10, 2012
Tweet

Transcript

  1. Zen of Python DevCamp Rennes #01 @Exirel

  2. I <3 Python • « PEP 8 » - Guido

    van Rossum • « PEP 20 - Zen of Python » - Tim Peters • « Python for Human » - Kenneth Reitz
  3. PEP 20 • beautiful > ugly • explicit > implicit

    • simple > complex • complex > complicated • flat > nested • sparse > dense
  4. PEP 20 • readability in count

  5. PEP 20 • if special_cases: raise NotEnoughSpecial( ‘Never break the

    rules.’)
  6. PEP 20 • practicality.beats(purity)

  7. PEP 20 • if not explicitly_silenced: raise Exception(‘Shout out errors!’)

    else: pass
  8. PEP 20 • with ambiguity: raise RefuseToGuess(‘Never guess!’)

  9. PEP 20 • if idea is simple_to_explain: print(‘May be it\’s

    ok.’) • if idea is hard_to_explain: raise BadIdea(‘Too complicated.’)
  10. MAKE IT SIMPLE

  11. MAKE IT BETTER

  12. MAKE IT PYTHON

  13. return ‘Merci’