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/120663.html below:

[Python-Dev] A Desperate Plea For Introspection (aka: BDFAP Needed)

[Python-Dev] A Desperate Plea For Introspection (aka: BDFAP Needed)Ethan Furman ethan at stoneleaf.us
Fri Jun 22 21:47:47 CEST 2012
Guido van Rossum wrote:
> On Fri, Jun 22, 2012 at 12:24 PM, Yury Selivanov
> <yselivanov.ml at gmail.com> wrote:
>> On 2012-06-22, at 3:18 PM, Guido van Rossum wrote:
>>
>>> On Fri, Jun 22, 2012 at 12:10 PM, Yury Selivanov
>>> <yselivanov.ml at gmail.com> wrote:
>>>> Yes, I meant optional.  Would 'name(arg1, *, [arg2])' be better?
>>> Hardly, because that's not valid syntax. I'd write name(arg1, *,
>>> arg2=<default>).
>> Like
>>
>>    replace(*, name=<default>, kind=<default>, default=<default>,
>>                                  annotation=<default>) -> Parameter
>>
>> or
>>
>>    replace(*, name=<optional>, kind=<optional>, default=<optional>,
>>                                  annotation=<optional>) -> Parameter
> 
> Either one's an improvement, but you'll have to explain at the top of
> the PEP what you intend this notation to mean. I'd go with <optional>
> since the key thing here seems to be that various keywords, when not
> specified, mean that nothing changes. OTOH in some places you can
> probably write "foo=Signature.empty" (etc.).

Parameter names that follow '*' in the signature are not optional 
(unless that has changed since 3.2).  In other words, the above 
signature requires that name, kind, default, and annotation be specified 
by name *and* be given values when replace is called)

~Ethan~
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