본문 바로가기

tech/computing

The Zen of Python

반응형

파이썬의 철학(PEP 20)이라고 불리기도 하고, import this 명령어를 실행하면 나오는 부활절 달걀.

 

import this

 

  1. 추잡한 것보다 아름다운게 낫다. : Beautiful is better than ugly.
  2. 암시적인 것보다 명시적인게 낫다. : Explicit is better than implicit.
  3. 복잡한 겁소다 단순한게 낫다. : Simple is better than complex.
  4. 난잡하게 꼬여있는 것보다 그래도 복잡한게 낫다. : Complex is better than complicated.
  5. 중첩되어 있는 것보다 평평한게 낫다. : Flat is better than nested.
  6. 밀도가 높은 것보다는 드문드문한게 낫다. : Sparse is better than dense.
  7. 가독성이 중요하다. : Readability counts.
  8. 특별한 경우는 규칙을 어길 정도로 특별하지는 않다. : Special cases aren’t special enough to break the rules.
  9. 실용성이 순수함을 능가할지라도 말이다. : Although practicality beats purity.
  10. 조용하게 에러를 지나쳐서는 안된다. : Errors should never pass silently.
  11. 명시적으로 조용히 넘어가지 않는다면… : Unless explicitly silenced.
  12. 모호함에 직면해서, 추측의 유혹을 거부하라. : In the face of ambiguity, refuse the temptation to guess.
  13. 명백한 방법이 하나만 있어야 된다. : There should be one—and preferably only one—obvious way to do it.
  14. 당신이 네덜란드 사람이 아니라면, 처음에는 그 방법이 명확하지 않을 수도 있지만, : Although that way may not be obvious at first unless you’re Dutch.
  15. 지금 당장이 전혀 하지 않는것보다 낫다. : Now is better than never.
  16. 전혀 하지 않는 것이 지금 당장 하는 것보다 좋을 수도 있지만, : Although never is often better than right now.
  17. 구현을 설명하기 힘들다면, 좋지 않다는 것이다. : If the implementation is hard to explain, it’s a bad idea.
  18. 구현을 설명하기 쉽다면, 좋을 수도 있다. : If the implementation is easy to explain, it may be a good idea.
  19. 네임스페이스는 번뜩이는 아이디어다 - 더 많이 실행하자 : Namespaces are one honking great idea—let’s do more of those!

출처 : https://statkclee.github.io/raspberry-pi/raspberry-pi-programming.html

반응형