

Namespaces are one honking great idea - let's do more of those!

If the implementation is easy to explain, it may be a good idea. Learn what are the Python Coding Best Practices that you must follow to write cleaner and more professional code. If the implementation is hard to explain, it's a bad idea. There should be one- and preferably only one -obvious way to do it.Īlthough that way may not be obvious at first unless you're Dutch.Īlthough never is often better than *right* now. In the face of ambiguity, refuse the temptation to guess. These approaches are undesirable, because they clutter the code. Ignoring the indentation of the commented code. In this article, we have presented our interpretation of the Zen of Python, guidelines created to motivate Python programmers to write clean, readable code. Inserting an empty line between a comment and its related code.
Zen of python decoration code#
Using all capital letters (we’ll see later an exception) Omitting an empty line after a piece of code above the comment.

Special cases aren't special enough to break the rules. Omitting a space between a hash and a comment. There is a well known Easter Egg in Python called import this that when added to your code will automatically output The Zen of Python, by Tim Peters
