Skip to main content
The 2024 Developer Survey results are live! See the results
Finally stumbled on the other corresponding related question
Source Link
Karl Knechtel
  • 61.2k
  • 13
  • 118
  • 165

In code like zip(*x) or f(**k), what do the * and ** respectively mean? How does Python implement that behaviour, and what are the performance implications?


See also: Expanding tuples into arguments. Please use that one to close questions where OP needs to use * on an argument and doesn't know it exists. Similarly, use Converting Python dict to kwargs? for the case of using **.

See What does ** (double star/asterisk) and * (star/asterisk) do for parameters? for the complementary question about parameters.

In code like zip(*x) or f(**k), what do the * and ** respectively mean? How does Python implement that behaviour, and what are the performance implications?


See also: Expanding tuples into arguments. Please use that one to close questions where OP needs to use * on an argument and doesn't know it exists.

See What does ** (double star/asterisk) and * (star/asterisk) do for parameters? for the complementary question about parameters.

In code like zip(*x) or f(**k), what do the * and ** respectively mean? How does Python implement that behaviour, and what are the performance implications?


See also: Expanding tuples into arguments. Please use that one to close questions where OP needs to use * on an argument and doesn't know it exists. Similarly, use Converting Python dict to kwargs? for the case of using **.

See What does ** (double star/asterisk) and * (star/asterisk) do for parameters? for the complementary question about parameters.

improve title (parallelism with the other canonical)
Source Link
Karl Knechtel
  • 61.2k
  • 13
  • 118
  • 165

What do the *** (stardouble star/asterisk) and *** (double starstar/asterisk) operators mean in a function call?

In code like zip(*x) or f(**k), what do the * and ** respectively mean? How does Python implement that behaviour, and what are the performance implications?


See also: Expanding tuples into arguments. Please use that one to close questions where OP needs to use * on an argument and doesn't know it exists.

See What does ** (double star/asterisk) and * (star/asterisk) do for parameters? for the complementary question about parameters.

What do the * (star) and ** (double star) operators mean in a function call?

In code like zip(*x) or f(**k), what do the * and ** respectively mean? How does Python implement that behaviour, and what are the performance implications?


See also: Expanding tuples into arguments. Please use that one to close questions where OP needs to use * on an argument and doesn't know it exists.

What do ** (double star/asterisk) and * (star/asterisk) mean in a function call?

In code like zip(*x) or f(**k), what do the * and ** respectively mean? How does Python implement that behaviour, and what are the performance implications?


See also: Expanding tuples into arguments. Please use that one to close questions where OP needs to use * on an argument and doesn't know it exists.

See What does ** (double star/asterisk) and * (star/asterisk) do for parameters? for the complementary question about parameters.

add see-also with closure guidance; focus and de-opinionate the question
Source Link
Karl Knechtel
  • 61.2k
  • 13
  • 118
  • 165

What does the * operator mean in Python, such as inIn code like zip(*x) or f(**k), what do the * and ** respectively mean? How does Python implement that behaviour, and what are the performance implications?

  1. How is it handled internally in the interpreter?
  2. Does it affect performance at all? Is it fast or slow?
  3. When is it useful and when is it not?
  4. Should it be used in a function declaration or in a call?

See also: Expanding tuples into arguments. Please use that one to close questions where OP needs to use * on an argument and doesn't know it exists.

What does the * operator mean in Python, such as in code like zip(*x) or f(**k)?

  1. How is it handled internally in the interpreter?
  2. Does it affect performance at all? Is it fast or slow?
  3. When is it useful and when is it not?
  4. Should it be used in a function declaration or in a call?

In code like zip(*x) or f(**k), what do the * and ** respectively mean? How does Python implement that behaviour, and what are the performance implications?


See also: Expanding tuples into arguments. Please use that one to close questions where OP needs to use * on an argument and doesn't know it exists.

improve title to match the corresponding canonical for parameters a bit better
Link
Karl Knechtel
  • 61.2k
  • 13
  • 118
  • 165
Loading
updated title to reflect entire scope of the question
Link
MisterMiyagi
  • 48.5k
  • 13
  • 120
  • 131
Loading
Post Reopened by Georgy, Daniel Widdis, tgdavies
edited title
Link
smci
  • 33.6k
  • 21
  • 116
  • 149
Loading
edited tags
Link
ShadowRanger
  • 151.7k
  • 12
  • 200
  • 295
Loading
Post Closed as "Duplicate" by Aran-Fey python
deleted 193 characters in body
Source Link
Aran-Fey
  • 42.2k
  • 13
  • 107
  • 158
Loading
Post Reopened by Aran-Fey python
Active reading.
Source Link
Peter Mortensen
  • 31.4k
  • 22
  • 109
  • 132
Loading
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot
Loading
Edited and removed language tag from question title.
Link
martineau
  • 122.4k
  • 29
  • 176
  • 307
Loading
edited tags; edited title
Link
tshepang
  • 12.3k
  • 24
  • 95
  • 138
Loading
Loading
added 5 characters in body
Source Link
Loading
insert duplicate link
Source Link
Loading
Post Closed as "exact duplicate" by Adrien Plisson, SilentGhost, Grzegorz Oledzki, jfs, Greg Hewgill
deleted 2 characters in body
Source Link
SilentGhost
  • 315.8k
  • 67
  • 309
  • 293
Loading
edited title; added 58 characters in body; added 24 characters in body
Source Link
psihodelia
  • 30.2k
  • 35
  • 109
  • 158
Loading
added 14 characters in body
Source Link
Joe Mastey
  • 27k
  • 13
  • 81
  • 104
Loading
edited tags
Link
SilentGhost
  • 315.8k
  • 67
  • 309
  • 293
Loading
Source Link
psihodelia
  • 30.2k
  • 35
  • 109
  • 158
Loading