dis446 / Shelter-Survival-Text-Based

An open source, text based version of the popular Bethesda Fallout Shelter game.
8 stars 7 forks source link

Manual PEP8-ify #22

Closed sgtlaggy closed 8 years ago

sgtlaggy commented 8 years ago

I'd like to take this on, but I just want to take @dis446's opinion on long function call lines, being the project owner. See https://gist.github.com/mikevb1/bb5b5253f1a8df5caf11 for reference,

Also, please enable "soft tabs" in whatever editor/IDE you use, I suggest a value of 4 spaces.

dis446 commented 8 years ago

That would actually be preferable. I had never seen functions being called like this. But they make sense and make code easier to read. Go ahead. And thank you for taking this on.

sgtlaggy commented 8 years ago

Which of the options would you prefer? None of them are functionally different, just stylistic and best to stick with one standard throughout.

dis446 commented 8 years ago

e5 looks the best. Each entity in it's own line. I don't like an ending bracket to be on it's own line though... Don't know why?

Talkyn commented 8 years ago

Please yes, no tabs. Just set your editor to use 4 spaces as tabs and it will get along with how everything in Python is written.

As for long calls and lists, this is what Python PEP-8 has to say about it. https://www.python.org/dev/peps/pep-0008/#indentation

Personally, I use something along the lines of e1, except when the line is already going to be long without the first argument, or due to long arguments. Then I will do e5. PEP-8 doesn't seem to have a real opinion one way or the other, but I like having that trailing bracket tucked up on the last line.

dis446 commented 8 years ago

I just want to say. Great work making the code more readable. The multi-line comments at the beginning of function definitions is great!

sgtlaggy commented 8 years ago

Those are called docstrings. Please read up on PEP8 and PEP257 for code and docstring formatting.