This is a discussion on Python’s forums about adding something akin to a throws keyword in python.

  • twoframesperminute@mastodon.social
    link
    fedilink
    arrow-up
    0
    ·
    1 year ago

    @sugar_in_your_tea I don’t think we should change any functionality when it comes to exception handling. Code based documentation would be great for type checking and auto-generated docs, but they can be done using annotations, not changed interfaces.

    Monads are already possible, but should not be the normal way to code either. It’s clunky and difficult to understand. It might work great for some scenarios, but doesn’t for many others.