mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 02:15:10 +00:00 
			
		
		
		
	 8fb307cd65
			
		
	
	
		8fb307cd65
		
	
	
	
	
		
			
			This commit fixes how one-line async-defs and defs are tracked by tokenizer. It allows to correctly parse invalid code such as: >>> async def f(): ... def g(): pass ... async = 10 and valid code such as: >>> async def f(): ... async def g(): pass ... await z As a consequence, is is now possible to have one-line 'async def foo(): await ..' functions: >>> async def foo(): return await bar()
		
			
				
	
	
		
			2 lines
		
	
	
	
		
			45 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			2 lines
		
	
	
	
		
			45 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| async def foo(a=await something()):
 | |
|     pass
 |