(self, suffix_length=4)
return new_nick
Returns a randomly generated nickname to use for client
        registration. Keeps track of which nicks are already in use globally.

        :param suffix_length: The maximum length for the randomly generated
                              nickname suffix.
Returns a randomly generated nickname to use for client
        registration. Keeps track of which nicks are already in use globally.
Returns a randomly generated nickname to use for client registration . Keeps track of which nicks are already in use globally .
def free_nick(self, suffix_length=4):
        """
        Returns a randomly generated nickname to use for client
        registration. Keeps track of which nicks are already in use globally.

        :param suffix_length: The maximum length for the randomly generated
                              nickname suffix.
        """
        
        # Trying the default nickname
        primary_nick = config.IRC_NICKNAME
        if primary_nick not in self._nick_stack:
            self._nick_stack.append(primary_nick)
            return primary_nick

        # Keep trying until we get a nickname that's not already in use.
        while True:
            new_nick = config.IRC_NICKNAME + '-{random_suffix:x}'.format(
                # By far the fastest pure-python method for a short hex
                # identifier.
                random_suffix=random.randrange(
                    16**suffix_length
                )
            )

            if new_nick not in self._nick_stack:
                break

        self._nick_stack.append(new_nick)
        return new_nick
def free_nick ( self , suffix_length = 4 ) : # Trying the default nickname primary_nick = config . IRC_NICKNAME if primary_nick not in self . _nick_stack : self . _nick_stack . append ( primary_nick ) return primary_nick # Keep trying until we get a nickname that's not already in use. while True : new_nick = config . IRC_NICKNAME + '-{random_suffix:x}' . format ( # By far the fastest pure-python method for a short hex # identifier. random_suffix = random . randrange ( 16 ** suffix_length ) ) if new_nick not in self . _nick_stack : break self . _nick_stack . append ( new_nick ) return new_nick