mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	bpo-45975: Simplify some while-loops with walrus operator (GH-29347)
This commit is contained in:
		
							parent
							
								
									25bc115df9
								
							
						
					
					
						commit
						024ac542d7
					
				
					 28 changed files with 41 additions and 153 deletions
				
			
		|  | @ -90,9 +90,7 @@ def _readmailcapfile(fp, lineno): | |||
|     the viewing command is stored with the key "view". | ||||
|     """ | ||||
|     caps = {} | ||||
|     while 1: | ||||
|         line = fp.readline() | ||||
|         if not line: break | ||||
|     while line := fp.readline(): | ||||
|         # Ignore comments and blank lines | ||||
|         if line[0] == '#' or line.strip() == '': | ||||
|             continue | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Nick Drozd
						Nick Drozd