mirror of
				https://github.com/ARM-software/workload-automation.git
				synced 2025-10-29 22:24:51 +00:00 
			
		
		
		
	utils/types: implement __ne__ for level
This should have been handled by the @total_ordering decorator, but
isn't due to
        https://bugs.python.org/issue25732
(briefly, total_ordering is back-ported from Python 3, where the base
object provides the default implementation of __ne__ based on __eq__, so
total_ordering did not override it; this, however does not happen in
Python 2).
Also update unit tests to catch this edge case.
			
			
This commit is contained in:
		
				
					committed by
					
						 setrofim
						setrofim
					
				
			
			
				
	
			
			
			
						parent
						
							64f9cf79e4
						
					
				
				
					commit
					6ee40c2170
				
			| @@ -569,6 +569,15 @@ class level(object): | ||||
|         else: | ||||
|             return self.value < other | ||||
|  | ||||
|     def __ne__(self, other): | ||||
|         if isinstance(other, level): | ||||
|             return self.value != other.value | ||||
|         elif isinstance(other, basestring): | ||||
|             return self.name != other | ||||
|         else: | ||||
|             return self.value != other | ||||
|  | ||||
|  | ||||
|  | ||||
| class _EnumMeta(type): | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user