mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
inspect.signature: Make sure that if a callable object has '_patialmethod'
attribute, that attribute is an instance of 'functools.partialmethod'.
This commit is contained in:
parent
c45873e434
commit
0486f819c9
2 changed files with 17 additions and 11 deletions
|
@ -1983,6 +1983,11 @@ class TestSignatureObject(unittest.TestCase):
|
|||
('c', 1, ..., 'keyword_only')),
|
||||
'spam'))
|
||||
|
||||
def test_signature_on_fake_partialmethod(self):
|
||||
def foo(a): pass
|
||||
foo._partialmethod = 'spam'
|
||||
self.assertEqual(str(inspect.signature(foo)), '(a)')
|
||||
|
||||
def test_signature_on_decorated(self):
|
||||
import functools
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue