Ben Finney wrote:
> Christoph Becker writes:
>
>> Ben Finney wrote:
>>
>>> It's best to remember that ‘lambda’ is syntactic sugar for creating
>>> a function; the things it creates are not special in any way, they
>>> are normal functions, not “lambdas”.
>>
>> Could you please elaborate why ‘lam
Am 09.12.2014 04:09 schrieb memilanuk:
so in the first example in my original post:
...
lambda: update_label2('A', 100)
would this work the same? It looks as though it'd be passing the same
two parameters to the same function...
lambda: 'A', 100: update_label2()
No. Even if it would be all
On 12/09/2014 02:15 AM, memilanuk wrote:
On 12/08/2014 09:30 PM, Ben Finney wrote:
memilanuk writes:
...
lambda: update_label2('A', 100)
would this work the same?
(I don't know what you mean here by “the same”; the same as what?)
The above creates a new function, which expects no paramete
On 12/08/2014 09:30 PM, Ben Finney wrote:
memilanuk writes:
...
lambda: update_label2('A', 100)
would this work the same?
(I don't know what you mean here by “the same”; the same as what?)
The above creates a new function, which expects no parameters (because
there are no parameters before
On Tuesday, December 9, 2014 5:28:49 AM UTC+5:30, Ben Finney wrote:
> memilanuk writes:
>
> > What I'm having trouble finding a concrete answer to is the difference
> > between:
>
> (Note that where you write “some_func” the syntax requires an
> expression, not a function. I've changed your examp
On Tue, 09 Dec 2014 02:44:12 +0100, Christoph Becker wrote:
> Ben Finney wrote:
>
>> It's best to remember that ‘lambda’ is syntactic sugar for creating a
>> function; the things it creates are not special in any way, they are
>> normal functions, not “lambdas”.
>
> Could you please elaborate wh
memilanuk writes:
> ...
> lambda: update_label2('A', 100)
>
> would this work the same?
(I don't know what you mean here by “the same”; the same as what?)
The above creates a new function, which expects no parameters (because
there are no parameters before its ‘:’).
The function, when called,
Christoph Becker writes:
> Ben Finney wrote:
>
> > It's best to remember that ‘lambda’ is syntactic sugar for creating
> > a function; the things it creates are not special in any way, they
> > are normal functions, not “lambdas”.
>
> Could you please elaborate why ‘lambda’ does not create “lambd
On 12/08/2014 03:58 PM, Ben Finney wrote:
memilanuk writes:
What I'm having trouble finding a concrete answer to is the difference
between:
lambda: some_expr
This creates a new function which expects zero parameters. The function,
when called, will return the value of ‘some_expr’.
lam
On 12/8/2014 8:53 PM, Chris Angelico wrote:
On Tue, Dec 9, 2014 at 12:44 PM, Christoph Becker wrote:
Ben Finney wrote:
It's best to remember that ‘lambda’ is syntactic sugar for creating a
function; the things it creates are not special in any way, they are
normal functions, not “lambdas”.
On Tue, Dec 9, 2014 at 12:44 PM, Christoph Becker wrote:
> Ben Finney wrote:
>
>> It's best to remember that ‘lambda’ is syntactic sugar for creating a
>> function; the things it creates are not special in any way, they are
>> normal functions, not “lambdas”.
>
> Could you please elaborate why ‘la
Ben Finney wrote:
> It's best to remember that ‘lambda’ is syntactic sugar for creating a
> function; the things it creates are not special in any way, they are
> normal functions, not “lambdas”.
Could you please elaborate why ‘lambda’ does not create “lambdas”. I'm
a Python beginner (not new to
On 2014-12-08 23:58, Ben Finney wrote:
memilanuk writes:
What I'm having trouble finding a concrete answer to is the difference
between:
(Note that where you write “some_func” the syntax requires an
expression, not a function. I've changed your examples to be clear).
lambda: some_expr
Th
On Tue, Dec 9, 2014 at 10:58 AM, Ben Finney wrote:
>> lambda x=some_value: some_expr
>
> This creates a new function which expects one parameter named ‘x’, which
> parameter has a default value of ‘some_value’. The function, when
> called, will return the value of ‘some_expr’.
*facepalm* For some
On 12/08/2014 03:43 PM, memilanuk wrote:
So... I was browsing some questions on reddit, and one of them
involved tkinter and lambdas. Managed to help the person out, but in
the process ended up with more questions of my own :/
My basic confusion revolves around this: in one instance I see t
memilanuk writes:
> What I'm having trouble finding a concrete answer to is the difference
> between:
(Note that where you write “some_func” the syntax requires an
expression, not a function. I've changed your examples to be clear).
> lambda: some_expr
This creates a new function which expects
On Tue, Dec 9, 2014 at 10:43 AM, memilanuk wrote:
> What I'm having trouble finding a concrete answer to is the difference
> between:
>
> lambda: some_func
>
> lambda e: some_func
These two are quite simple. (In each case, it's an expression, not a
function, for what it's worth.) They're (roughly
So... I was browsing some questions on reddit, and one of them involved
tkinter and lambdas. Managed to help the person out, but in the process
ended up with more questions of my own :/
My basic confusion revolves around this: in one instance I see things
like the following:
R1 = tk.Radio
18 matches
Mail list logo