mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 10:26:02 +00:00 
			
		
		
		
	 5dbe0f59b7
			
		
	
	
		5dbe0f59b7
		
			
		
	
	
	
	
		
			
			- drop TargetScopeError in favour of raising SyntaxError directly as per the updated PEP 572 - comprehension iteration variables are explicitly local, but named expression targets in comprehensions are nonlocal or global. Raise SyntaxError as specified in PEP 572 - named expression targets in the outermost iterable of a comprehension have an ambiguous target scope. Avoid resolving that question now by raising SyntaxError. PEP 572 originally required this only for cases where the bound name conflicts with the iteration variable in the comprehension, but CPython can't easily restrict the exception to that case (as it doesn't know the target variable names when visiting the outermost iterator expression)
		
			
				
	
	
		
			64 lines
		
	
	
	
		
			1.8 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			64 lines
		
	
	
	
		
			1.8 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
| BaseException
 | |
|  +-- SystemExit
 | |
|  +-- KeyboardInterrupt
 | |
|  +-- GeneratorExit
 | |
|  +-- Exception
 | |
|       +-- StopIteration
 | |
|       +-- StopAsyncIteration
 | |
|       +-- ArithmeticError
 | |
|       |    +-- FloatingPointError
 | |
|       |    +-- OverflowError
 | |
|       |    +-- ZeroDivisionError
 | |
|       +-- AssertionError
 | |
|       +-- AttributeError
 | |
|       +-- BufferError
 | |
|       +-- EOFError
 | |
|       +-- ImportError
 | |
|       |    +-- ModuleNotFoundError
 | |
|       +-- LookupError
 | |
|       |    +-- IndexError
 | |
|       |    +-- KeyError
 | |
|       +-- MemoryError
 | |
|       +-- NameError
 | |
|       |    +-- UnboundLocalError
 | |
|       +-- OSError
 | |
|       |    +-- BlockingIOError
 | |
|       |    +-- ChildProcessError
 | |
|       |    +-- ConnectionError
 | |
|       |    |    +-- BrokenPipeError
 | |
|       |    |    +-- ConnectionAbortedError
 | |
|       |    |    +-- ConnectionRefusedError
 | |
|       |    |    +-- ConnectionResetError
 | |
|       |    +-- FileExistsError
 | |
|       |    +-- FileNotFoundError
 | |
|       |    +-- InterruptedError
 | |
|       |    +-- IsADirectoryError
 | |
|       |    +-- NotADirectoryError
 | |
|       |    +-- PermissionError
 | |
|       |    +-- ProcessLookupError
 | |
|       |    +-- TimeoutError
 | |
|       +-- ReferenceError
 | |
|       +-- RuntimeError
 | |
|       |    +-- NotImplementedError
 | |
|       |    +-- RecursionError
 | |
|       +-- SyntaxError
 | |
|       |    +-- IndentationError
 | |
|       |         +-- TabError
 | |
|       +-- SystemError
 | |
|       +-- TypeError
 | |
|       +-- ValueError
 | |
|       |    +-- UnicodeError
 | |
|       |         +-- UnicodeDecodeError
 | |
|       |         +-- UnicodeEncodeError
 | |
|       |         +-- UnicodeTranslateError
 | |
|       +-- Warning
 | |
|            +-- DeprecationWarning
 | |
|            +-- PendingDeprecationWarning
 | |
|            +-- RuntimeWarning
 | |
|            +-- SyntaxWarning
 | |
|            +-- UserWarning
 | |
|            +-- FutureWarning
 | |
|            +-- ImportWarning
 | |
|            +-- UnicodeWarning
 | |
|            +-- BytesWarning
 | |
|            +-- ResourceWarning
 |