Like in C ++, we have certain coding standards that help us write proper code by following defined coding conventions. Are there any coding standards in Python?
2 comments
Leave a comment
You must be logged in to post a comment.
Like in C ++, we have certain coding standards that help us write proper code by following defined coding conventions. Are there any coding standards in Python?
You must be logged in to post a comment.
Its always a nice idea to follow coding conventions & standards. Code commenting also helps a lot in understanding the code written by other developers. The following need to be given attention to: Naming conventions, Code layout, Indentation, Comments.
For python, the standard that is followed is PEP8. PEP8 defines the style guide for python coding. A full style guide is documented in official python.org site: https://www.python.org/dev/peps/pep-0008/
You may also like to read – when NOT to use PEP8 @ https://realpython.com/python-pep8/#when-to-ignore-pep-8
You can also refer to Google Python Style Guide. This style guide is a list of dos and don’ts for Python programs.
See: https://google.github.io/styleguide/pyguide.html