program designminimize cross-file changes other ways to access globals scopes and nested functions nested scope details nested scope examples factory functionsclosures retaining enclosing scope state with defaults the nonlocal statement in nonlocal basics nonlocal in action why nonlocalstate retention options state with nonlocal only state with globalsa single copy only state with classesexplicit attributes (previewstate with function attributes and summary test your knowledgequiz test your knowledgeanswers arguments argument-passing basics arguments and shared references avoiding mutable argument changes simulating output parameters and multiple results special argument-matching modes argument matching basics argument matching syntax the gritty details keyword and default examples arbitrary arguments examples python keyword-only arguments the min wakeup callfull credit bonus points the punch line generalized set functions emulating the python print function using keyword-only arguments summary test your knowledgequiz test your knowledgeanswers table of contents xv