Force a Python Function to Only Accept Keyword Arguments Created: Mar 4, 2022 · Updated: Sep 18, 2026 34 words #python Part of python In Python 3, you can force a function to only accept keyword arguments (even without default values) by making the first parameter an asterisk *. Example# def myfunc(*, a, b, c): ... Source# Source This is a note from my working notes — 132 public notes that grow and get revised, unlike the dated posts.