from sys import maxsize

class Сontact:
    #делаем конструктор
    def __init__(self, firstname=None, middlename=None, lastname=None,  nickname=None, title=None, company=None, address=None, home=None,
                 mobile=None, work=None, all_phones_from_homepage=None , all_emails_from_homepage=None, email=None, email2=None,
                 email3=None, birth_date=None, birth_month=None, birth_year=None, id=None):
        self.firstname = firstname
        self.middlename = middlename
        self.lastname = lastname
        self.nickname = nickname
        self.title = title
        self.company = company
        self.address = address
        self.home = home
        self.mobile = mobile
        self.work = work
        self.email = email
        self.email2 = email2
        self.email3 = email3
        self.birth_date = birth_date
        self.birth_month = birth_month
        self.birth_year = birth_year
        self.all_phones_from_homepage = all_phones_from_homepage
        self.all_emails_from_homepage = all_emails_from_homepage
        self.id = id

    def __repr__(self):
        return "%s:%s:%s;%s;%s" % (self.id, self.firstname, self.lastname, self.middlename, self.nickname)

    def __eq__(self, other):
        return (self.id is None or other.id is None or self.id == other.id) and self.firstname == other.firstname and self.lastname == other.lastname

    def id_or_max(self):
        if self.id:
            return int(self.id)
        else:
            return maxsize