[TriPython] Editing a list in a function
Mark Hutchinson
aikimark at aol.com
Wed Aug 11 20:58:44 EDT 2021
Oops. My bad.
Thanks for the catch/correction, Calvin.
Mark
-----Original Message-----
From: Calvin Spealman <ironfroggy at gmail.com>
To: Mark Hutchinson <aikimark at aol.com>; Triangle (North Carolina) Python Users Group (formerly TriZPUG) <trizpug at python.org>
Sent: Wed, Aug 11, 2021 1:31 pm
Subject: Re: [TriPython] Editing a list in a function
On Wed, Aug 11, 2021 at 12:31 PM Mark Hutchinson via TriZPUG <trizpug at python.org> wrote:
Once your function begins to 'alter' the input list parameter, it becomes
a new list. Unless your function uses the Global keyword to refer to the
variable in the code outside the function.
Mark
This is absolutely not true. Lists are mutable, modifying them is a mutation of the original list.
_______________________________________________
TriZPUG mailing list
TriZPUG at python.org
https://mail.python.org/mailman/listinfo/trizpug
http://tripython.org is the Triangle Python Users Group
--
Read my blog! I depend on your acceptance of my opinion! I am interesting!
http://hub.ironfroggy.com/
Follow me if you're into that sort of thing: http://www.twitter.com/ironfroggy
-------------- next part --------------
Oops. My bad.
Thanks for the catch/correction, Calvin.
Mark
-----Original Message-----
From: Calvin Spealman <ironfroggy at gmail.com>
To: Mark Hutchinson <aikimark at aol.com>; Triangle (North Carolina) Python
Users Group (formerly TriZPUG) <trizpug at python.org>
Sent: Wed, Aug 11, 2021 1:31 pm
Subject: Re: [TriPython] Editing a list in a function
On Wed, Aug 11, 2021 at 12:31 PM Mark Hutchinson via TriZPUG
<[1]trizpug at python.org> wrote:
Once your function begins to 'alter' the input list parameter, it
becomes
a new list. Unless your function uses the Global keyword to refer to
the
variable in the code outside the function.
Mark
This is absolutely not true. Lists are mutable, modifying them is a
mutation of the original list.
_______________________________________________
TriZPUG mailing list
[2]TriZPUG at python.org
[3]https://mail.python.org/mailman/listinfo/trizpug
[4]http://tripython.org is the Triangle Python Users Group
--
Read my blog! I depend on your acceptance of my opinion! I am interesting!
[5]http://hub.ironfroggy.com/
Follow me if you're into that sort of thing:
[6]http://www.twitter.com/ironfroggy
References
Visible links
1. mailto:trizpug at python.org
2. mailto:TriZPUG at python.org
3. https://mail.python.org/mailman/listinfo/trizpug
4. http://tripython.org/
5. http://hub.ironfroggy.com/
6. http://www.twitter.com/ironfroggy
More information about the TriZPUG
mailing list