Suppose there is such a piece of code:
>>> def add (x,y):
... return x + y
...
>>> c = add.__code__
For Python3, we can get the keyword parameter to be 0 through c.co_kwonlyargcount
. For Python2, how to implement equivalent writing and get the corresponding keyword parameter? quantity.
https://docs.python.org/2/lib...
The number of parameters obtained by python2 and python3 is different: