mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	__iter__(): New method so that StringIO's can participate in the
iterator protocol.
This commit is contained in:
		
							parent
							
								
									038d26410d
								
							
						
					
					
						commit
						bdefa0b3de
					
				
					 1 changed files with 3 additions and 0 deletions
				
			
		|  | @ -45,6 +45,9 @@ def __init__(self, buf = ''): | |||
|         self.closed = 0 | ||||
|         self.softspace = 0 | ||||
| 
 | ||||
|     def __iter__(self): | ||||
|         return iter(self.readline, '') | ||||
| 
 | ||||
|     def close(self): | ||||
|         if not self.closed: | ||||
|             self.closed = 1 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Barry Warsaw
						Barry Warsaw