def __setValueInternal( self, value, reason ) :

		# update our validator based on the type of the value
		numericType = type( value )
		assert( numericType is int or numericType is float )
		if self.__numericType is not numericType :

			self.__numericType = numericType

			if self.__numericType is int :
				validator = QtGui.QIntValidator( self._qtWidget() )
			else :
				validator = QtGui.QDoubleValidator( self._qtWidget() )
				validator.setDecimals( 4 )
				validator.setNotation( QtGui.QDoubleValidator.StandardNotation )

			self._qtWidget().setValidator( validator )

		# update our textual value
		text = self.__valueToString( value )
		dragBeginOrEnd = ( self.ValueChangedReason.DragBegin, self.ValueChangedReason.DragEnd ) in reason

		if text == self.getText() and not dragBeginOrEnd :
			# early out if the text hasn't changed. we never early out if the reason is
			# drag start or drag end, as we want to maintain matching pairs so things
			# make sense to client code.
			return

		self.setText( text )
		self.__emitValueChanged( reason )
dataset/ETHPy150Open ImageEngine/gaffer/python/GafferUI/NumericWidget.py/NumericWidget.__setValueInternal/swapped operands of `in`