maybe,
it indicates that
- All parameters left of the / are treated as positional-only.
def func(a, b, /, c=1, *, d=2):
print('hello')
func(1, 2) # valid
func(1, b=2) # invalid
- If / is not specified in the function definition, that function does not accept any positional-only arguments.
def func(a, b, c=1, *, d=2):
print('hello')
func(a=1, b=2) # valid
func(1, 2) # valid
- The logic around optional values for positional-only parameters remains the same as for positional-or-keyword parameters.
def func(a, b=1, /, c=1, *, d=2):
print('hello')
func(1, 2) # valid
func(1) # valid
- Once a positional-only parameter is specified with a default, the following positional-only and positional-or-keyword parameters need to have defaults as well.
def func(a, b=1, /, c, *, d=2): # invalid
- Positional-only parameters which do not have default values are required positional-only parameters.
def func(a, b=1, /, c=3, *, d=2):
print('hello')
func(b=2) # invalid
func(1, b=2) # invalid
func(1) # valid
func(1, 2) # valid
for the OP case, it appears that it is point 2.
after *
, it is keyword only parameters.
before *
, both positional and keyword parameters are valid.