3. Functions¶
- 3.1. Never Unpack More Than Three Variables When Functions Return Multiple Values
- 3.2. Prefer Raising Exceptions to Returning None
- 3.3. Know How Closures Interact with Variable Scope
- 3.4. Reduce Visual Noise with Variable Positional Arguments
- 3.5. Provide Optional Behavior with Keyword Arguments
- 3.6. Use None and Docstrings to Specify Dynamic Default Arguments
- 3.7. Enforce Clarity with Keyword-Only and Positional-Only Arguments
- 3.8. Define Function Decorators with functools.wraps