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


Groups > comp.lang.python > #80252

Re: What is the difference between these two? (Assigning functions to variables)

Newsgroups comp.lang.python
Date 2014-11-04 23:33 -0800
References <3de3eb9f-f0ae-494d-973f-0b9829af54d7@googlegroups.com> <mailman.15477.1415167196.18130.python-list@python.org>
Message-ID <c0183806-cb7a-48bb-989f-42baa3177f63@googlegroups.com> (permalink)
Subject Re: What is the difference between these two? (Assigning functions to variables)
From Max Nathaniel Ho <maxhowl86@gmail.com>

Show all headers | View raw


On Wednesday, November 5, 2014 2:00:08 PM UTC+8, Cameron Simpson wrote:
> On 04Nov2014 19:17, Max Nathaniel Ho <maxhowl86@gmail.com> wrote:
> >Just to be clear, I was referring to these two lines
> >
> >greet = compose_greet_func()
> >
> >greet_someone = greet
> 
> Please don't top-post. Thanks.
> 
> Your first assignment:
> 
>    greet = compose_greet_func()
> 
> _calls_ (runs) the compose_greet_func and assigns its return value to greet.
> 
> Your second assignment:
> 
>    greet_someone = greet
> 
> assigns the current value of "greet", whatever that is, to "greet_someone". No 
> function is called.
> 
> Cheers,
> Cameron Simpson <cs@zip.com.au>

Apologies about the top posting.

Ahh okay, thank you for your explanation

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


Thread

What is the difference between these two? (Assigning functions to variables) Max Nathaniel Ho <maxhowl86@gmail.com> - 2014-11-04 19:15 -0800
  Re: What is the difference between these two? (Assigning functions to variables) Max Nathaniel Ho <maxhowl86@gmail.com> - 2014-11-04 19:17 -0800
    Re: What is the difference between these two? (Assigning functions to variables) Cameron Simpson <cs@zip.com.au> - 2014-11-05 16:59 +1100
      Re: What is the difference between these two? (Assigning functions to variables) Max Nathaniel Ho <maxhowl86@gmail.com> - 2014-11-04 23:33 -0800

csiph-web