mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	remove most uses of list(somedict.keys()) in Demo scripts
This commit is contained in:
		
							parent
							
								
									28a181cbe8
								
							
						
					
					
						commit
						1e8ce58f5d
					
				
					 17 changed files with 31 additions and 46 deletions
				
			
		|  | @ -12,7 +12,7 @@ def __init__(self, filename, mode, perm): | |||
| 
 | ||||
|     def __repr__(self): | ||||
|         s = '' | ||||
|         for key in list(self.keys()): | ||||
|         for key in self.keys(): | ||||
|             t = repr(key) + ': ' + repr(self[key]) | ||||
|             if s: t = ', ' + t | ||||
|             s = s + t | ||||
|  | @ -32,7 +32,7 @@ def __delitem__(self, key): | |||
| 
 | ||||
|     def keys(self): | ||||
|         res = [] | ||||
|         for key in list(self.db.keys()): | ||||
|         for key in self.db.keys(): | ||||
|             res.append(eval(key)) | ||||
|         return res | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Skip Montanaro
						Skip Montanaro