0
What Is PEP 8 ?
can you explain
3 Antworten
+ 3
PEP 8 is a code styling guide for Python.
It guides Python developers on many things that will affect readability and consistency of code. These are things like:
- lines of code shouldn't be more than 80 characters.
- Functions that aren't indented at all(not methods) should have 2 blank lines between them.
- case for function names should be snake case.
There are many more suggestions that I can't remember. I think most teams using Python tend to adopt several and follow them perfectly while some PEP 8 recommendations get virtually ignored.
It is a bunch of stuff that helps everyone's code look like it was written by the same developer even if it was written by a team.
Breaking a PEP 8 suggestion will never stop your Python script from running but some code editors may highlight the affected lines and sometimes a teammate will get mildly annoyed by it.
Check out the official PEP 8 documentation at:
https://www.python.org/dev/peps/pep-0008/
+ 1
Python Enhanced Proposal 8 (PEP 8) provides standards and guidelines of how best to write python code
0
What is PEP 8?