diff options
| author | Benjamin Peterson <benjamin@python.org> | 2011-07-29 23:19:43 (GMT) |
|---|---|---|
| committer | Benjamin Peterson <benjamin@python.org> | 2011-07-29 23:19:43 (GMT) |
| commit | c4607aeedd19fad5e5fe1a6a72a0c79d014ee4e1 (patch) | |
| tree | 7b854ccc3b42a80fdb62f6a3fa82ece2a394c281 /Lib/test | |
| parent | 4f921c2e061507f6d93002c454e063db2acaf7ea (diff) | |
| download | cpython-c4607aeedd19fad5e5fe1a6a72a0c79d014ee4e1.zip cpython-c4607aeedd19fad5e5fe1a6a72a0c79d014ee4e1.tar.gz cpython-c4607aeedd19fad5e5fe1a6a72a0c79d014ee4e1.tar.bz2 | |
make the types of None and Ellipsis callable
Diffstat (limited to 'Lib/test')
| -rw-r--r-- | Lib/test/test_builtin.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py index aa9b4e2..145ae69 100644 --- a/Lib/test/test_builtin.py +++ b/Lib/test/test_builtin.py @@ -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): |
