How can I encforce some function parameters to be only positional only
问题 I want to mimic this behaviour of Python3.8 in Python3.7 Positional-only parameters / was the syntax introduced to indicate that some function parameters must be specified positionally and cannot be used as keyword arguments. #Python3.8 def f(a,b,/,**kwargs): print(a,b,kwargs) >>> f(1,2,**{'a':100,'b':200,'c':300}) # 1 2 {'a': 100, 'b': 200, 'c': 300} a , b are used only as positional parameters. How I do the same in Python3.7 #Python3.7 def f(a,b,**kwargs): print(a,b,kwargs) >>> f(1,2,**{'a'