mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Code by Inyeol Lee, submitted to SF bug 595350, to implement
the string/unicode method .replace() with a zero-lengt first argument. Inyeol contributed tests for this too.
This commit is contained in:
		
							parent
							
								
									280488b9a3
								
							
						
					
					
						commit
						8b1a6d694f
					
				
					 5 changed files with 59 additions and 46 deletions
				
			
		|  | @ -202,6 +202,10 @@ def run_method_tests(test): | |||
|     test('replace', 'one!two!three!', 'one@two@three@', '!', '@') | ||||
|     test('replace', 'one!two!three!', 'one!two!three!', 'x', '@') | ||||
|     test('replace', 'one!two!three!', 'one!two!three!', 'x', '@', 2) | ||||
|     test('replace', 'abc', '-a-b-c-', '', '-') | ||||
|     test('replace', 'abc', '-a-b-c', '', '-', 3) | ||||
|     test('replace', 'abc', 'abc', '', '-', 0) | ||||
|     test('replace', '', '', '', '') | ||||
|     # Next three for SF bug 422088: [OSF1 alpha] string.replace(); died with | ||||
|     # MemoryError due to empty result (platform malloc issue when requesting | ||||
|     # 0 bytes). | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Guido van Rossum
						Guido van Rossum