• Ethan
    link
    fedilink
    English
    arrow-up
    6
    ·
    1 day ago

    “Assume it’s a map and treat like a map and then catch the type error if it’s not.” Paraphrased from actual advice by Guido on how you should write Python. Python isn’t a bad language but the philosophy that comes along with it is so fucked.

      • Ethan
        link
        fedilink
        English
        arrow-up
        4
        ·
        16 hours ago

        And relying on runtime validation is a horrific way to write production code

        • manicdave@feddit.uk
          link
          fedilink
          arrow-up
          2
          arrow-down
          1
          ·
          15 hours ago

          Why though? I’ve genuinely never had a problem with it. If something is wrong, it was always going to be wrong. Why is it preferable to have to write a bunch of bolierplate than just deal with the stacktrace when you do encounter a type error?