• Zeusbottom@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    0
    ·
    11 months ago

    It’s very weird to me that Python, as an inherently untyped language, is trying to bolt on stronger typing through modules like Protocol and typing.

    If typing is a good thing, why not make it an optional first-class part of the language? Maybe make strong typing a one liner option at the top of a source file? This growing maze of modules and recommendations is so unwieldy. For example, the typing module works kind of in conjunction with language elements that aren’t what newbs learn in Python 101, like type specifiers in function args. I feel like this stuff is driving Python away from simplicity.

    • rglullis@communick.newsOP
      link
      fedilink
      English
      arrow-up
      0
      arrow-down
      1
      ·
      11 months ago

      I don’t get this complaint.

      Python is not adding typing, it’s just improving on its static type checker. Nothing is really changing at runtime. Even if your type annotations are completely wrong, your code will run just fine. It’s up for the developers and the team to know how much they will benefit from adopting it.