New submission from Frederick Wagner: [First-time contributor, feedback appreciated.]
Found and fixed some unexpected behavior in inspect.BoundArguments.apply_defaults. Simplest explanation is the following test that I added: # Make sure a no-args binding still acquires proper defaults. def foo(a='spam'): pass sig = inspect.signature(foo) ba = sig.bind() ba.apply_defaults() self.assertEqual(list(ba.arguments.items()), [('a', 'spam')]) I've included the patch file; is there anything else I can do? ---------- components: Library (Lib), Tests files: 0001-Make-apply_defaults-work-for-empty-arguments.patch keywords: patch messages: 260157 nosy: Frederick Wagner priority: normal severity: normal status: open title: BoundArguments.apply_defaults doesn't handle empty arguments type: behavior versions: Python 3.5, Python 3.6 Added file: http://bugs.python.org/file41906/0001-Make-apply_defaults-work-for-empty-arguments.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26347> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com