Browse Source

Merge 3.5 (issue #26347)

pull/9921/head
Yury Selivanov 11 years ago
parent
commit
06495ffe93
  1. 2
      Lib/inspect.py
  2. 7
      Lib/test/test_inspect.py

2
Lib/inspect.py

@ -2571,8 +2571,6 @@ class BoundArguments:
empty dict.
"""
arguments = self.arguments
if not arguments:
return
new_arguments = []
for name, param in self._signature.parameters.items():
try:

7
Lib/test/test_inspect.py

@ -3325,6 +3325,13 @@ class TestBoundArguments(unittest.TestCase):
ba.apply_defaults()
self.assertEqual(list(ba.arguments.items()), [])
# 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')])
class TestSignaturePrivateHelpers(unittest.TestCase):
def test_signature_get_bound_param(self):

Loading…
Cancel
Save