mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 11:49:12 +00:00 
			
		
		
		
	Fix print function conversion missed in merge of faq/programming update.
This commit is contained in:
		
							parent
							
								
									c04a694614
								
							
						
					
					
						commit
						18163c3f14
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
					@ -310,7 +310,7 @@ This is because when you make an assignment to a variable in a scope, that
 | 
				
			||||||
variable becomes local to that scope and shadows any similarly named variable
 | 
					variable becomes local to that scope and shadows any similarly named variable
 | 
				
			||||||
in the outer scope.  Since the last statement in foo assigns a new value to
 | 
					in the outer scope.  Since the last statement in foo assigns a new value to
 | 
				
			||||||
``x``, the compiler recognizes it as a local variable.  Consequently when the
 | 
					``x``, the compiler recognizes it as a local variable.  Consequently when the
 | 
				
			||||||
earlier ``print x`` attempts to print the uninitialized local variable and
 | 
					earlier ``print(x)`` attempts to print the uninitialized local variable and
 | 
				
			||||||
an error results.
 | 
					an error results.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
In the example above you can access the outer scope variable by declaring it
 | 
					In the example above you can access the outer scope variable by declaring it
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue