On 2012-06-14, at 10:50 AM, Alexandre Zani wrote: > On Thu, Jun 14, 2012 at 6:50 AM, Yury Selivanov <yselivanov...@gmail.com> > wrote: >> I guess if nobody really wants to keep 'is_args', we can alter the >> PEP. >> >> Let's consider replacement of 'Parameter.is_*' set of attributes with >> a single 'Parameter.kind' attribute, which will have the following >> possible values: 'positional', 'vararg', 'keyword-only', 'varkwarg'. >> >> (I think 'positional' is more intuitive than 'index'?) >> > > I disagree largely for readability reasons. As the PEP stands, I can > look at a Parameter object and immediately understand what the > different possible values are by just listing its attributes. The kind > attribute makes that harder. > > Comparing with strings is error prone. If I do param.is_varargs > (adding an s at the end of the attribute name) I will see an attribute > error and know what is going on. If I do the same mistake with the > kind attribute param.kind == "varargs", the expression will just > always be False without any explanation.
Agree on this one, good point (although unit tests generally help to avoid those problems.) - Yury _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com