• Bobo The Great@sopuli.xyz
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    6 months ago

    Partially unrelated to the meme, but I find it almost malicious how some python keywords are named differently from the nearly universal counterpart of other languagues.

    This/self, continue/pass, catch/except and they couldn’t find a different word for switch so they just didn’t implement it.

    It’s as if the original designers purposefully wanted to be different for the sake of it.

    • CanadaPlus@lemmy.sdf.org
      link
      fedilink
      arrow-up
      1
      ·
      6 months ago

      PHP naming “::” a Paamayim Nekudotayim is also pretty infamous.

      When I’m designing shit, I’m pretty zealous about borrowing terminology from anything even vaguely related to avoid this.

  • WolfLink@sh.itjust.works
    link
    fedilink
    arrow-up
    1
    ·
    6 months ago

    In Python, self is not a keyword, it’s a conventional variable name. You can replace all instances of “self” with “this” and your code will work the same.

    • Dr. Bluefall@toast.ooo
      link
      fedilink
      English
      arrow-up
      1
      ·
      6 months ago

      It’s either a reference to an object instance, or the instance itself (depending on whether you specified &mut self, &self or just self).