[Python-ideas] Issues with inspect.Parameter

Antony Lee antony.lee at berkeley.edu
Wed Nov 13 20:35:39 CET 2013


Here we go: http://bugs.python.org/issue19573


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

> 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/20131113/916afc2e/attachment-0001.html>


More information about the Python-ideas mailing list