class Person:
    def __init__(self, firstname, lastname):
        self.firstname = firstname
        self.lastname = lastname

    # 氏・名共に等しければ同値とする
    def __eq__(self, other):
        if isinstance(other, Person):
            return self.firstname == other.firstname and \
                self.lastname == other.lastname

        return False

    # ハッシュ値を演算
    def __hash__(self):
        return hash((self.firstname, self.lastname))

if __name__ == '__main__':
    p = Person('太郎', '山田')
    dic = {p: '男'}
    print(dic[p])
b7fbcc3d51ed54a3adc408ba005e21c5b651c0d7
class Person:
    <mask token>

    def __eq__(self, other):
        if isinstance(other, Person):
            return (self.firstname == other.firstname and self.lastname ==
                other.lastname)
        return False
    <mask token>


<mask token>

class Person:

    def __init__(self, firstname, lastname):
        self.firstname = firstname
        self.lastname = lastname

    def __eq__(self, other):
        if isinstance(other, Person):
            return (self.firstname == other.firstname and self.lastname ==
                other.lastname)
        return False
    <mask token>


<mask token>

class Person:

    def __init__(self, firstname, lastname):
        self.firstname = firstname
        self.lastname = lastname

    def __eq__(self, other):
        if isinstance(other, Person):
            return (self.firstname == other.firstname and self.lastname ==
                other.lastname)
        return False

    def __hash__(self):
        return hash((self.firstname, self.lastname))


<mask token>

class Person:

    def __init__(self, firstname, lastname):
        self.firstname = firstname
        self.lastname = lastname

    def __eq__(self, other):
        if isinstance(other, Person):
            return (self.firstname == other.firstname and self.lastname ==
                other.lastname)
        return False

    def __hash__(self):
        return hash((self.firstname, self.lastname))


if __name__ == '__main__':
    p = Person('太郎', '山田')
    dic = {p: '男'}
    print(dic[p])

class Person:
    def __init__(self, firstname, lastname):
        self.firstname = firstname
        self.lastname = lastname

    # 氏・名共に等しければ同値とする
    def __eq__(self, other):
        if isinstance(other, Person):
            return self.firstname == other.firstname and \
                self.lastname == other.lastname

        return False

    # ハッシュ値を演算
    def __hash__(self):
        return hash((self.firstname, self.lastname))

if __name__ == '__main__':
    p = Person('太郎', '山田')
    dic = {p: '男'}
    print(dic[p])