mirror of
				https://github.com/ARM-software/devlib.git
				synced 2025-11-04 07:51:21 +00:00 
			
		
		
		
	utils/types: implement __ne__ for caseless_string
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).
This commit is contained in:
		
				
					committed by
					
						
						setrofim
					
				
			
			
				
	
			
			
			
						parent
						
							51452d204c
						
					
				
				
					commit
					f1c945bb5e
				
			@@ -106,6 +106,11 @@ class caseless_string(str):
 | 
			
		||||
            other = other.lower()
 | 
			
		||||
        return self.lower() == other
 | 
			
		||||
 | 
			
		||||
    def __ne__(self, other):
 | 
			
		||||
        if isinstance(other, basestring):
 | 
			
		||||
            other = other.lower()
 | 
			
		||||
        return self.lower() != other
 | 
			
		||||
 | 
			
		||||
    def __lt__(self, other):
 | 
			
		||||
        if isinstance(other, basestring):
 | 
			
		||||
            other = other.lower()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user