mirror of
				https://github.com/astral-sh/ruff.git
				synced 2025-10-31 12:05:57 +00:00 
			
		
		
		
	
		
			
				
	
	
	
	
		
			228 B
		
	
	
	
	
	
	
	
			
		
		
	
	
			228 B
		
	
	
	
	
	
	
	
Walrus operator
Basic
x = (y := 1) + 1
reveal_type(x)  # revealed: Literal[2]
reveal_type(y)  # revealed: Literal[1]
Walrus self-addition
x = 0
(x := x + 1)
reveal_type(x)  # revealed: Literal[1]
