Loading topic
print, work with lists, and read a simple traceback. The previous chapter showed that a name is a label bound to an object. This chapter covers where those labels are stored and which part of a program can see them.5 min readprint, work with lists, and read a simple traceback. The earlier chapters introduced names, binding, and namespaces. This chapter applies them to the namespace a function creates each time it runs.5 min readprint, work with lists, and read a simple traceback. It does not cover the global statement. A later chapter handles that.6 min readglobal or nonlocal statement says otherwi7 min readUnboundLocalError case). You also need to have seen the global statement. Here you will see how a nested function reb6 min readnonlocal chapters. Here the focus is one common bug: closures c6 min readglobal and nonlocal statements. Here we turn those rules into habits that keep scope bugs out of your c6 min read