def next_id(self):
    if hasattr(self, '__dgram_id'):
        answer = self.__dgram_id
    else:
        self.__dgram_id = randint(1, 65535)
        answer = self.__dgram_id
    self.__dgram_id += 1
    return answer
def next_id(self):
    if hasattr(self, '__dgram_id'):
        answer = self.__dgram_id
    else:
        self.__dgram_id = randint(1, 65535)
        answer = self.__dgram_id
    self.__dgram_id += 1
    return answer