Support Python 3.8+ functions with positional-only arguments.

Review Request #10918 — Created Feb. 25, 2020 and submitted — Latest diff uploaded

Information

kgb
master

Reviewers

kgb

Python 3.8 added syntax for positional-only arguments, which is not
compatible with prior releases. This involved changes to the CodeType
parameters and function signatures.

It unfortunately did not implement this new support in
inspect.getfullargspec(), meaning we finally needed to move fully over
to the inspect.Signature support. This involved a fair amount of work
in the inspection and formatting code for functions. It also required
that we call into an internal function in the inspect module, which is
needed in order to retain some state in the signature that is otherwise
not available publicly.

The end result is that we can now spy on functions with positional-only
arguments in Python 3.8+.

Unit tests pass on Python 2.7 and 3.5-3.8.

Ran the full Djblets and Review Board test suites on all supported
versions of Python without errors.

Commits

Files

    Loading...