python - Test if a function is threadsafe -


i have function this

def party_id_generator(size=6, chars=string.ascii_uppercase + string.digits):     party_ids = []     seen = set()     while len(party_ids) < 2:         party_id_str = ''.join(random.choice(string.ascii_uppercase) x in range(5))         party_id_dig = ''.join(random.choice(string.digits) x in range(3))         party_id = ''.join([party_id_str,party_id_dig])         if party_id in seen:             continue         seen.add(party_id)         party_ids.append(party_id)     return party_ids 

how know if function thread safe or not ?


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -