[Python-ideas] Issues with inspect.Parameter

Antony Lee antony.lee at berkeley.edu
Wed Nov 13 08:41:08 CET 2013


I have a (fairly trivial...) patch to fix both of these issues.  Should I
post it here or submit it to bugs.python.org?
Antony


2013/11/10 Antony Lee <antony.lee at berkeley.edu>

> The docstring of inspect.Parameter indicates the "default" and
> "annotation" attributes are not set if the parameter does not have,
> respectively, a default value and an annotation, and that the "kind"
> attribute is a string.
> But in fact, the "default" and "annotation" attributes are set to
> "inspect._empty (== Parameter.empty)" in that case, and the "kind"
> attribute has type "_ParameterKind" (essentially a hand-written equivalent
> of IntEnum).  I suggest to correct the docstring accordingly, and to
> replace the implementation of _ParameterKind by a proper IntEnum (if full
> backwards compatibility is required), or even just by Enum (which makes a
> bit more sense, as the fact that _ParameterKind is a subclass of int
> doesn't seem to be documented anywhere).
> Antony
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20131112/66c47425/attachment.html>


More information about the Python-ideas mailing list