What does a bare asterisk do in a parameter list? What are “keyword-only” parameters?

Bare * is used to force the caller to use named arguments – so you cannot define a function with * as an argument when you have no following keyword arguments.

See this answer or Python 3 documentation for more details.

Leave a Comment