For Python code, PEP 257 provides a convention for using docstrings to document structural entities: packages, modules, functions, classes, and methods. This covers pretty much everything. Stack Overflow questions about how to comment Python code invariably elicit answers saying to use docstrings. Where does …
Tag: conventions
Is there a standardized method to swap two variables in Python?
In Python, I’ve seen two variable values swapped using this syntax: Is this considered the standard way to swap two variable values or is there some other means by which two variables are by convention most usually swapped? Answer Python evaluates expressions from left to right. Notice that while evalua…