Missing exceptions in PEP 3107

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Carl Banks

    #16
    Re: Missing exceptions in PEP 3107

    On Aug 17, 9:34 am, Christoph Zwerschke <c...@online.de wrote:
    Carl Banks schrieb:
    >
    You are free to use it for other things.  For example, the following
    usage is obvious and sensible (insofar as listing exceptions is
    sensible):
    >
    def f(x : int) -int, raises(TypeErro r)
    >
    Think of the return value annotation as more of a function outcome
    annotation.
    >
    That's fine, but then this should be mentioned in the PEP3107.
    Evidently the thing that really needs to be mentioned in the PEP is
    "don't be pedantic".

    Instead
    it says explicitly that the "->" syntax is for "the type of a function's
    return value". If it's intended to be used in a more general way like
    you suggested, then the wording used in the PEP is misleading. (The
    wording "*the* type is problematic anyway, since a Python function can
    return different types in different situations.)
    For some reason, you keep trying to interpret the PEP's description as
    policy.

    Once again: the PEP disclaims all authority on policy. If the PEP
    intended you to use the annotations only for what it said the
    annotations were for, then it wouldn't have disclaimed that authority.

    It's still unclear for me whether annotations on thrown exceptions are
    included in PEP3107 (as per your suggestion), or are not covered by
    PEP3107 at all (as Duncan suggests), or whether this question has just
    not yet been settled.
    According to the PEP you can do anything you want with the
    annotations. PEP 3107 does not specify policy. There is no question
    to settle.

    If it bothers you that much, go file a bug report. Someone might even
    change it. But it's nothing but needless pedantry.


    Carl Banks

    Comment

    • Christoph Zwerschke

      #17
      Re: Missing exceptions in PEP 3107

      Carl Banks wrote:
      If it bothers you that much, go file a bug report. Someone might even
      change it. But it's nothing but needless pedantry.
      Has my "de" domain inspired you to rant about "pedantry"? No, it does
      not bother me that much. I just thought the PEP could be clearer here
      and explicitly mention the thrown exceptions as a use case instead of
      only speaking about return values. Of course, if you're Dutch, it may be
      obvious, but for a dimwitted German things are not always obvious.

      -- Christoph

      Comment

      • Carl Banks

        #18
        Re: Missing exceptions in PEP 3107

        On Aug 17, 7:25 pm, Christoph Zwerschke <c...@online.de wrote:
        Carl Banks wrote:
        If it bothers you that much, go file a bug report.  Someone might even
        change it.  But it's nothing but needless pedantry.
        >
        Has my "de" domain inspired you to rant about "pedantry"?
        Actually, no.


        Carl Banks

        P.S. My great-grandfather's surname was "von Bank" when he emigrated
        to America.

        Comment

        Working...