Код: Выделить всё
class DiscordUser:
def __init__(self, username):
self.username = username
def __hash__(self):
return hash(self.username)
Код: Выделить всё
user = DiscordUser("Username#123")
if user in users_set:
# user is already in my users_set, such condition is NEVER MET, dont understand why
else:
# add user to users_set, this condition is met ALWAYS
users_set.add(user)
Подробнее здесь: https://stackoverflow.com/questions/667 ... set-python