'스위치'에 해당되는 글 1건

  1. 2012.07.20 Python에서의 Switch 구현

 

http://stackoverflow.com/questions/60208/replacements-for-switch-statement-in-python

 

  1. http://code.activestate.com/recipes/410692/

  2. http://code.activestate.com/recipes/410695/

  3. http://code.activestate.com/recipes/181064/

 

테스트 해본 결과 - if elif를 사용한 switch는 여전히 느림

 

Dictionary를 쓰는 경우는 빠를 수는 있지만, 많은 경우의 dictionary를 정의하는 것은 무식한 방법임

다음의 lambda를 쓰거나 bisect를 쓰는 방법이 빠를 듯 함.

 

내가 원하는 해법이 들어 있음

http://stackoverflow.com/questions/2222859/python-dictionary-instead-of-switch-case

Posted by trigger
,