mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
make the types of None and Ellipsis callable
This commit is contained in:
parent
4f921c2e06
commit
c4607aeedd
4 changed files with 73 additions and 0 deletions
|
@ -1343,6 +1343,13 @@ class BuiltinTest(unittest.TestCase):
|
|||
self.assertRaises(ValueError, x.translate, b"1", 1)
|
||||
self.assertRaises(TypeError, x.translate, b"1"*256, 1)
|
||||
|
||||
def test_construct_singletons(self):
|
||||
for const in None, Ellipsis:
|
||||
tp = type(const)
|
||||
self.assertIs(tp(), const)
|
||||
self.assertRaises(TypeError, tp, 1, 2)
|
||||
self.assertRaises(TypeError, tp, a=1, b=2)
|
||||
|
||||
class TestSorted(unittest.TestCase):
|
||||
|
||||
def test_basic(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue