3 ms·
Choosing either implementation as "more Pythonic" than the other feels to me like choosing tabs over spaces, or vice versa: https://www.youtube.com/watch?v=V7P
by cs702 5y ago
Choosing either implementation as "more Pythonic" than the other feels to me like choosing tabs over spaces, or vice versa:
https://www.youtube.com/watch?v=V7PLxL8jIl8 https://www.youtube.com/watch?v=V7PLxL8jIl8
i.e., it's a matter of personal preference -- except that, as gizmo686 points out below, as of Python 3 tabs are now, officially, considered more Pythonic.
- gizmo686 5y agoSpaces are more pythonic than tabs. https://www.python.org/dev/peps/pep-0008/#tabs-or-spaces https://www.python.org/dev/peps/pep-0008/#tabs-or-spaces
- philipov 5y agohttps://flinhong.github.io/images/201607/tabs-spaces.jpg https://flinhong.github.io/images/201607/tabs-spaces.jpg
- cs702 5y agoLOL. That cartoon is particularly funny because it is rather insightful about the nature of such disagreements.
- heavenlyblue 5y agoMy own personal take on this is that I don't care whether it's tabs vs spaces as long as it's consistent. But if you mix both (especially in Python code), then you should be dead by now. By the way, one of the popular Python packages pyaml uses tabs (consistently though). Not a good example, but still.
- neolog 5y agoNo. Once you've internalized the idioms of the language, it becomes obvious that TFA's preferred solution is in the Python style and the other is not.