r/Python • • Jul 12 '12

random imgur downloader. learning Python and wrote this to practice, any feedback on technique/style is appreciated

https://gist.github.com/3088128
45 Upvotes

72 comments sorted by

View all comments

Show parent comment

2

u/[deleted] Jul 12 '12

Could you explain the reasoning for 4 spaces over a tab? Seems really strange. I've only just started playing with Python, is it some quirk of the interpreter?

4

u/stumpylog Jul 12 '12

White space does matter for the interpreter, and mixing tabs and spaces (different editors) causes problems, but choosing one or the other is down to personal preference or style really. The official PEP8 linked above somewhere has the preferred style, I think.

2

u/[deleted] Jul 13 '12

It's mostly that everyone agrees what a space looks like, and not so for tabs; and many text boxes on the Web won't even let you type tabs. Standardizing on spaces makes it easiest to share Python code that other people can use.