Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

__ne__

class Foo:
  def __init__(self, num):
    self.num = num
    
  def __eq__(self, other):
    return self.num == other.num
  
  def __ne__(self, other): # __ne__ represents the != operator
    return self.num != other.num
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
2+5 =