Re: Missing exceptions in PEP 3107
On Aug 17, 9:34 am, Christoph Zwerschke <c...@online.de wrote:
Evidently the thing that really needs to be mentioned in the PEP is
"don't be pedantic".
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.
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
On Aug 17, 9:34 am, Christoph Zwerschke <c...@online.de wrote:
Carl Banks schrieb:
>
>
>
>
That's fine, but then this should be mentioned in the PEP3107.
>
You are free to use it for other things. For example, the following
usage is obvious and sensible (insofar as listing exceptions is
sensible):
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.
annotation.
That's fine, but then this should be mentioned in the PEP3107.
"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.)
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.)
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.
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.
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