• 0 Posts
  • 77 Comments
Joined 6 months ago
cake
Cake day: December 21st, 2024

help-circle





  • takeda@lemm.eetoLemmy Shitpost@lemmy.worldOof
    link
    fedilink
    arrow-up
    1
    arrow-down
    1
    ·
    1 month ago

    First of all, this is about being PoC not about having certain political view.

    Or do you think there is a reason that people with different skin color vote certain way?

    Second, if this was the community I encountered some time ago, then it was mere tagging so people couldn’t pretend to be someone who they aren’t. You still could post there without being black.

    But anyway this was about political groups. I don’t see “leftists” subreddits requiring a purity check like I see on nearly every conservative subreddit.













  • takeda@lemm.eetomemes@lemmy.worldDon't do it
    link
    fedilink
    arrow-up
    7
    arrow-down
    1
    ·
    2 months ago

    Are you sure?

    I can’t test it now, but to me it looks like () is an empty tuple. Python behavior is that for logic operations empty set equals to false. Then we apply not to get True. Not having space between not operator and parentheses makes it look like it is a function.


  • takeda@lemm.eetomemes@lemmy.worldDon't do it
    link
    fedilink
    arrow-up
    24
    arrow-down
    1
    ·
    edit-2
    2 months ago

    Python, but this is actually defined and documented behavior.

    Edit: to illustrate what I mean:

    not() # True
    

    this actually is not () (the lack of space makes it look like a function), () is a tuple, in python an empty collection returns False, this is to make checks simpler. You can type:

    if my_list:
      do something
    

    instead of

    if len(my_list) > 0:
      do something
    

    not negates it so you get True

    str(not()) # 'True'
    

    converts resulting bool type into a string representation

    min(str(not())) # 'T'
    

    This might feel odd, but that’s also documented. min() not only allows to compare two numbers like it is in most languages, but you can also provide a sequence of values and it will return the smallest one.

    String is a sequence of letters.

    Letters are comparable according to ASCII (so you can do sorting). In ASCII table capital letters are first, so the ‘T’ is the smallest value.

    ord(min(str(not()))) # 84
    

    this just converts ‘T’ to Unicode value which is 84

    range(ord(min(str(not())))) # range(0, 84)
    

    This creates a sequence of numbers from 0 to 83

    sum(range(ord(min(str(not()))))) # 3486
    

    This works like min() except adds up all the numbers in the sequence together, so in our case 0+1+2+3+…+83 = 3486

    chr(sum(range(ord(min(str(not())))))) # 'ඞ'
    

    reverse of ord(), converts Unicode value to a character.