mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Take namedtuple item names only from ascii_letters (this blew up on OSX),
and make sure there are no duplicate names.
This commit is contained in:
		
							parent
							
								
									f899dfa1d1
								
							
						
					
					
						commit
						0bb0299ad8
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		|  | @ -110,7 +110,9 @@ def test_odd_sizes(self): | |||
| 
 | ||||
|         n = 10000 | ||||
|         import string, random | ||||
|         names = [''.join([random.choice(string.letters) for j in range(10)]) for i in range(n)] | ||||
|         names = list(set(''.join([random.choice(string.ascii_letters) | ||||
|                                   for j in range(10)]) for i in range(n))) | ||||
|         n = len(names) | ||||
|         Big = namedtuple('Big', names) | ||||
|         b = Big(*range(n)) | ||||
|         self.assertEqual(b, tuple(range(n))) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Georg Brandl
						Georg Brandl