• Zagorath
    link
    fedilink
    English
    18 days ago

    I’m imagining something like this:

    def add_member(group, user):
        if (len(group.members) <= GROUP_CHAT_LIMIT):
            ...
    

    If GROUP_CHAT_LIMIT is 8 bits, this does not work.

    • @Passerby6497@lemmy.world
      link
      fedilink
      English
      48 days ago

      So add a +1 like you would for any index to count comparison?

      I guess I’m failing to see how this doesn’t work as long as you properly handle the comparison logic. Maybe you can explain how this doesn’t work…