On Thu, Apr 24, 2014 at 01:14:33AM -0700, Albert-Jan Roskam wrote:
> - Original Message -
> > From: Steven D'Aprano
> > To: tutor@python.org
> > Cc:
> > Sent: Thursday, April 24, 2014 3:00 AM
> > Subject: Re: [Tutor] global list
> >
>
> From: Peter Otten <__pete...@web.de>
>To: tutor@python.org
>Sent: Thursday, April 24, 2014 1:49 PM
>Subject: Re: [Tutor] global list
>
>
>Albert-Jan Roskam wrote:
>> - Original Message -
>>> From: Steven
Albert-Jan Roskam wrote:
>
>
>
>
>
> - Original Message -
>> From: Steven D'Aprano
>> To: tutor@python.org
>> Cc:
>> Sent: Thursday, April 24, 2014 3:00 AM
>> Subject: Re: [Tutor] global list
>>
>
>
>
On 04/23/2014 06:46 PM, Denis Heidtmann wrote:
In a coursera python course video the following code was presented:
a = [4,5,6]
def mutate_part(x):
a[1] = x
mutate_part(200)
The presenter said something like "a is a global variable, so a becomes
[4,200,6] after running mutate_part(200)."
On 24/04/2014 09:23, Danny Yoo wrote:
Should have no runtime performance difference.
For similar reasons, using a very long variable name does not change a
program's runtime performance.
Please quote some context, this is meaningless without it, thanks.
--
My fellow Pythonistas, ask not wha
Should have no runtime performance difference.
For similar reasons, using a very long variable name does not change a
program's runtime performance.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.pyth
- Original Message -
> From: Steven D'Aprano
> To: tutor@python.org
> Cc:
> Sent: Thursday, April 24, 2014 3:00 AM
> Subject: Re: [Tutor] global list
>
> You only need to define variables as global if you assign to them:
>
> def function(x):
>
On Wed, Apr 23, 2014 at 04:46:49PM -0700, Denis Heidtmann wrote:
> In a coursera python course video the following code was presented:
>
> a = [4,5,6]
>
> def mutate_part(x):
> a[1] = x
>
> mutate_part(200)
>
> The presenter said something like "a is a global variable, so a becomes
>
> [4,
In a coursera python course video the following code was presented:
a = [4,5,6]
def mutate_part(x):
a[1] = x
mutate_part(200)
The presenter said something like "a is a global variable, so a becomes
[4,200,6] after running mutate_part(200)."
Indeed it does, but why does this work without s