mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #10518: Bring back the callable() builtin.
Approved by Guido (BDFL) and Georg (RM).
This commit is contained in:
parent
dc9b17d922
commit
e71362d3de
5 changed files with 61 additions and 14 deletions
|
@ -174,8 +174,8 @@ class BoolTest(unittest.TestCase):
|
|||
self.assertIs(hasattr([], "wobble"), False)
|
||||
|
||||
def test_callable(self):
|
||||
self.assertIs(hasattr(len, '__call__'), True)
|
||||
self.assertIs(hasattr(1, '__call__'), False)
|
||||
self.assertIs(callable(len), True)
|
||||
self.assertIs(callable(1), False)
|
||||
|
||||
def test_isinstance(self):
|
||||
self.assertIs(isinstance(True, bool), True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue