Top "Pep8" questions

Coding conventions and style guidelines for Python.

Python `if x is not None` or `if not x is None`?

I've always thought of the if not x is None version to be more clear, but Google's style guide and …

python coding-style nonetype boolean-expression pep8
What is PEP8's E128: continuation line under-indented for visual indent?

Just opened a file with Sublime Text (with Sublime Linter) and noticed a PEP8 formatting error that I'd never seen …

python sublimetext2 pep8
Should I use "camel case" or underscores in python?

So which is better and why? def my_function(): or def myFunction():

python naming-conventions pep8
How do I set the maximum line length in PyCharm?

I am using PyCharm on Windows and want to change the settings to limit the maximum line length to 79 characters, …

python pycharm pep8
PyLint, PyChecker or PyFlakes?

I would like to get some feedback on these tools on : features; adaptability; ease of use and learning curve.

python pylint pep8 pyflakes pychecker
Why does PEP-8 specify a maximum line length of 79 characters?

Why in this millennium should Python PEP-8 specify a maximum line length of 79 characters? Pretty much every code editor under …

python coding-style pep8
what is trailing whitespace and how can I handle this?

some piece of my codes: if self.tagname and self.tagname2 in list1: try: question = soup.find("div", "post-text") title = …

python pep8
How to properly use python's isinstance() to check if a variable is a number?

I found some old Python code that was doing something like: if type(var) is type(1): ... As expected, pep8 complains …

python python-2.5 pep8
How to write very long string that conforms with PEP8 and prevent E501

As PEP8 suggests keeping below the 80 column rule for your python program, how can I abide to that with long …

python string pep8
Python: using 4 spaces for indentation. Why?

While coding python I'm using only 2 spaces to indent, sure PEP-8 really recommend to have 4 spaces, but historically for me …

python indentation conventions pep8