Python Forum
passing an argument to avoid a global
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
passing an argument to avoid a global
#1
i have a sort key function that needs an int passed to it by the caller of sorted() that will effect how it sets up the key to be compared. i want to do this without using a global. anyone have an idea how?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
passing an argument to avoid a global - by Skaperen - Jul-11-2019, 06:21 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Passing Argument Errors cosmarchy 6 2,469 Sep-29-2021, 06:09 AM
Last Post: snippsat
  Passing argument from top-level function to embedded function JaneTan 2 2,283 Oct-15-2020, 03:50 PM
Last Post: deanhystad
  SyntaxError: positional argument follows keyword argument syd_jat 3 5,866 Mar-03-2020, 08:34 AM
Last Post: buran
  Passing an argument by reference Exsul 12 4,748 Aug-22-2019, 07:29 AM
Last Post: DeaD_EyE
  Global variable does not seem to be global. Columbo 6 3,730 Jul-15-2019, 11:00 PM
Last Post: Columbo
  help with threading module and passing global variables ricardons 1 7,882 Feb-21-2019, 12:48 PM
Last Post: stullis
  Is This Code Ok? How Can I Avoid Using Global Variables? digitalmatic7 9 5,868 Feb-15-2018, 09:32 AM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

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