Count the number of arguments of a function.
(func)
| 18 | range_ = range |
| 19 | |
| 20 | def argc_(func): |
| 21 | """Count the number of arguments of a function.""" |
| 22 | return len(inspect.signature(func).parameters) |
| 23 | |
| 24 | def decode_string(bytestring): |
| 25 | """Decode C bytestring to ordinary string.""" |