Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
which is more Pythonic?
#2
The first one is better, because lesser code in function signature.
Additionally you have the reference to the list.

This can help you, if you have more than one function, which needs the list.
Then you can reuse the list in other function calls, but if you change the
list, everything is affected. This is why it's a bad idea to mutate a list
in a function.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


Messages In This Thread
which is more Pythonic? - by Skaperen - Jul-15-2019, 04:07 AM
RE: which is more Pythonic? - by DeaD_EyE - Jul-15-2019, 08:40 AM
RE: which is more Pythonic? - by metulburr - Jul-15-2019, 11:44 AM
RE: which is more Pythonic? - by Skaperen - Jul-15-2019, 08:24 PM
RE: which is more Pythonic? - by metulburr - Jul-15-2019, 08:52 PM
RE: which is more Pythonic? - by Skaperen - Jul-16-2019, 01:00 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  which is "better" (or more Pythonic)? Skaperen 2 2,080 Feb-01-2020, 03:10 PM
Last Post: Skaperen
  which is "better" (or more Pythonic)? Skaperen 7 3,258 Feb-01-2020, 03:51 AM
Last Post: Skaperen
  which is "better" (or more Pythonic)? Skaperen 8 3,396 Nov-16-2019, 06:46 PM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020