Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #99134

Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

Path csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Jussi Piitulainen <harvesting@is.invalid>
Newsgroups comp.lang.python
Subject Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)
Date Fri, 20 Nov 2015 10:49:21 +0200
Organization A noiseless patient Spider
Lines 33
Message-ID <lf5bnapm4xa.fsf@ling.helsinki.fi> (permalink)
References <CAPTjJmpwjWnF=d6mpgbKS1biVLoR4APutgyH0n9t6CJ=Kh4dCg@mail.gmail.com> <mailman.508.1448005763.16136.python-list@python.org>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Injection-Info mx02.eternal-september.org; posting-host="305c68510616a2e7ac08bcd2ff1598bd"; logging-data="16916"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/k7gWwhMpW+hCoi8A7OBTaRYwn6ieQ3po="
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)
Cancel-Lock sha1:u9KXXkHQ8NjgSYAdrwGS4pBXAoM= sha1:Az2R0zA67ycIEFcwOuTZkvuitsU=
Xref csiph.com comp.lang.python:99134

Show key headers only | View raw


dieter writes:
> Chris Angelico writes:
>
>> IMO it's controversial mainly because there's an easy and obvious
>> syntax for early binding, but late binding doesn't have syntactic
>> support, and all the options are imperfect.
>
> I do not think that we should get additional syntax for lately bound
> default values. It would explicitely introduce the concepts early
> versus late binding which are likely difficult to understand by many
> users.

I'm confused by the term. I don't like it one bit.

"Early binding" of a default value seems to mean that the expression
that produces the default value of a function parameter is evaluated
when the function is defined. "Late binding" seems to mean that the
expression is evaluated when the function is called.

In both cases the actual binding of the parameter to the value (either
the default or an actual argument) is established when the function is
called. Several different bindings of that same parameter to different
values can hold simultaneously, so the *binding* has to be conceptually
"late". Because recursion.

Why isn't the evaluation of the default expression called evaluation?
Or at least something that doesn't already mean something else that is
as crucially important as, well, I've already given up on talking about
REDACTED and REDACTED in connection with Python, and here I see related
established terminology used for something else *for no reason that I
can see*.

I see no *need* to call this other thing "binding".

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?) dieter <dieter@handshake.de> - 2015-11-20 08:49 +0100
  Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?) Jussi Piitulainen <harvesting@is.invalid> - 2015-11-20 10:49 +0200
    Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?) dieter <dieter@handshake.de> - 2015-11-21 08:26 +0100

csiph-web