CONTENTS i 1 General Python FAQ 1 1.1 General Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1.1 What is Python? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1.2 What is the Python Software Foundation? . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1.3 Are there copyright restrictions on the use of Python? . . . . . . . . . . . . . . . . . . . 1 1.1.4 Why was Python created in the first place? . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.1.5 What is Python good for? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.1.6 How does the Python version numbering scheme work? . . . . . . . . . . . . . . . . . . 2 1.1.7 How do I obtain a copy of the Python source? . . . . . . . . . . . . . . . . . . . . . . . 3 1.1.8 How do I get documentation on Python? . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.1.9 I’ve never programmed before. Is there a Python tutorial? . . . . . . . . . . . . . . . . . 3 1.1.10 Is there a newsgroup or mailing list devoted to Python? . . . . . . . . . . . . . . . . . . . 3 1.1.11 How do I get a beta test version of Python? . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.1.12 How do I submit bug reports and patches for Python? . . . . . . . . . . . . . . . . . . . 4 1.1.13 Are there any published articles about Python that I can reference? . . . . . . . . . . . . . 4 1.1.14 Are there any books on Python? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.1.15 Where in the world is www.python.org located? . . . . . . . . . . . . . . . . . . . . . . 4 1.1.16 Why is it called Python? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.1.17 Do I have to like “Monty Python’s Flying Circus”? . . . . . . . . . . . . . . . . . . . . . 4 1.2 Python in the real world . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.2.1 How stable is Python? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.2.2 How many people are using Python? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.2.3 Have any significant projects been done in Python? . . . . . . . . . . . . . . . . . . . . . 5 1.2.4 What new developments are expected for Python in the future? . . . . . . . . . . . . . . 5 1.2.5 Is it reasonable to propose incompatible changes to Python? . . . . . . . . . . . . . . . . 5 1.2.6 Is Python a good language for beginning programmers? . . . . . . . . . . . . . . . . . . 5 2 Programming FAQ 7 2.1 General Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.1.1 Is there a source code level debugger with breakpoints, single-stepping, etc.? . . . . . . . 7 2.1.2 Are there tools to help find bugs or perform static analysis? . . . . . . . . . . . . . . . . . 7 2.1.3 How can I create a stand-alone binary from a Python script? . . . . . . . . . . . . . . . . 8 2.1.4 Are there coding standards or a style guide for Python programs? . . . . . . . . . . . . . 8 2.2 Core Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.2.1 Why am I getting an UnboundLocalError when the variable has a value? . . . . . . . . . . 8 2.2.2 What are the rules for local and global variables in Python? . . . . . . . . . . . . . . . . 9 2.2.3 Why do lambdas defined in a loop with different values all return the same result? . . . . . 10 2.2.4 How do I share global variables across modules? . . . . . . . . . . . . . . . . . . . . . . 10 2.2.5 What are the “best practices” for using import in a module? . . . . . . . . . . . . . . . . 11 2.2.6 Why are default values shared between objects? . . . . . . . . . . . . . . . . . . . . . . 11 2.2.7 How can I pass optional or keyword parameters from one function to another? . . . . . . . 12 2.2.8 What is the difference between arguments and parameters? . . . . . . . . . . . . . . . . 13 2.2.9 Why did changing list ‘y’ also change list ‘x’? . . . . . . . . . . . . . . . . . . . . . . . . 13 2.2.10 How do I write a function with output parameters (call by reference)? . . . . . . . . . . . 14