mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Remove a dict.has_key() and callable() usage in SimpleXMLRPCServer as triggered
under -3 through test_xmlrpc.
This commit is contained in:
		
							parent
							
								
									c3ce0e53ad
								
							
						
					
					
						commit
						0a0f608244
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -141,7 +141,7 @@ def list_public_methods(obj): | ||||||
| 
 | 
 | ||||||
|     return [member for member in dir(obj) |     return [member for member in dir(obj) | ||||||
|                 if not member.startswith('_') and |                 if not member.startswith('_') and | ||||||
|                     callable(getattr(obj, member))] |                     hasattr(getattr(obj, member), '__call__')] | ||||||
| 
 | 
 | ||||||
| def remove_duplicates(lst): | def remove_duplicates(lst): | ||||||
|     """remove_duplicates([2,2,2,1,3,3]) => [3,1,2] |     """remove_duplicates([2,2,2,1,3,3]) => [3,1,2] | ||||||
|  | @ -315,7 +315,7 @@ def system_methodHelp(self, method_name): | ||||||
|         Returns a string containing documentation for the specified method.""" |         Returns a string containing documentation for the specified method.""" | ||||||
| 
 | 
 | ||||||
|         method = None |         method = None | ||||||
|         if self.funcs.has_key(method_name): |         if method_name in self.funcs: | ||||||
|             method = self.funcs[method_name] |             method = self.funcs[method_name] | ||||||
|         elif self.instance is not None: |         elif self.instance is not None: | ||||||
|             # Instance can implement _methodHelp to return help for a method |             # Instance can implement _methodHelp to return help for a method | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Brett Cannon
						Brett Cannon