A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2012-June/120099.html below:

[Python-Dev] Updated PEP 362 (Function Signature Object)

[Python-Dev] Updated PEP 362 (Function Signature Object) [Python-Dev] Updated PEP 362 (Function Signature Object)Alexandre Zani alexandre.zani at gmail.com
Mon Jun 11 08:20:07 CEST 2012
On Sun, Jun 10, 2012 at 11:13 PM, Benjamin Peterson <benjamin at python.org> wrote:
> 2012/6/10 Alexandre Zani <alexandre.zani at gmail.com>:
>>
>> I prefer the flags. Flags means I can just look at the Parameter
>> object. A "type" or "kind" or whatever means I need to compare to a
>> bunch of constants. That's more stuff to remember.
>
> I don't see why remembering 4 names is any harder than remember four attributes.

If it's 4 flags, you can tab-complete on the signature object itself,
the meaning of the flags are self-documenting and if you make a
mistake, you get an AttributeError which is easier to debug. Also,

param.is_args

is much simpler/cleaner than

param.type == "args"

or

param.type == inspect.Parameter.VARARGS

>
>
> --
> Regards,
> Benjamin
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4