testing-cabal/funcsigs

Add apply_defaults method to BoundArguments (from Python 3.5)

BlckKnght opened this issue · 0 comments

Python 3.5 extended the inspect.BoundArguments class, adding a new apply_defaults method which updates arguments with default values for any parameters that haven't been bound yet.

See Python issue 24190 for the discussion and the patch implementing the change (including doc changes and tests). I've not tried it myself, but I suspect that patch should almost work for this backported version of the code as well. The additions to the main library code should be fine. The test code however might need to be simplified a tiny bit to avoid using features that don't exist in older Python versions (e.g. annotations).