Designing a clear function interface
Python supports positional arguments, keyword arguments, default values and keyword-only parameters. These features allow an API to be convenient while still making important options explicit.
Be careful with mutable defaults
Default argument expressions are evaluated when the function is defined, not every time it is called. A default list or dictionary can therefore accidentally become shared state between calls. Use None and create a new object inside the function when needed.
Keyword-only options
A * in a function signature can make later parameters keyword-only. This is useful for options such as timeouts, flags and configuration values because the caller must name them.
Practice: design a send_email() function with a required recipient and keyword-only subject, priority and timeout options.