파이썬 스택은 push대신 append?

1 개념[ | ]

파이썬 스택은 push대신 append?
  • 다른 프로그래밍 언어들은 스택 구현에 push와 pop을 사용함. 귀도 반 로섬(파이썬 창시자)은 기존에 존재하는 append와 동일한 기능을 가진 다른 이름의 pop을 추가하는 것을 긍정적으로 생각하지 않음

To implement a stack, one would need to add a list.pop() primitive (and no, I'm not against this particular one on the basis of any principle). list.push() could be added for symmetry with list.pop() but I'm not a big fan of multiple names for the same operation -- sooner or later you're going to read code that uses the other one, so you need to learn both, which is more cognitive load.

귀도 반 로섬

2 같이 보기[ | ]

3 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}