가 그때 나는 같은 표현을 사용할 수있는 이유는 두 셀은, a와 b 객체가 셀 클래스파이썬 클래스의 메소드는 어떻게 작동합니까?
class Cell :
def __init__(self,char):
self.char=char
self.image='_'
def __str__(self):
return self.image
def __eq__(self,other):
return self.image == other.image
def __ne__(self,other):
return not self.image == other.image
이 "만약 A = B :!"이 두 개체를 비교합니다. b가 어떻게 내부에 들어가고 eq이라는 방법으로 전화를 걸면 비교가 이루어지지 않습니다.