Python Forum
pass value to function with * and/or **
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pass value to function with * and/or **
#4
normally, when the caller is not using * or **, but the function is defined with * or **, they are tuple and dictionary. what i am wondering is, if the caller does use * and/or **, does what the caller provides get passed through to the function as-is, or does it go through the argument handling mechanisms that give the function a tuple and dictionary. maybe the mechanism of setting up the call uses what is provided with * and ** and sets up a function call like any other call, then it all gets unwound (to a tuple and/or dictionary) as the function sets up to run. it comes down to how function calls are implemented unless this is defined somewhere (i haven't seen it). other Python implementations could do this different than how CPython does it, if it's not defined.
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
RE: pass value to function with * and/or ** - by Skaperen - Jan-10-2020, 08:19 AM

Forum Jump:

User Panel Messages

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