Python operator 模块,delslice() 实例源码

我们从Python开源项目中,提取了以下4个代码示例,用于说明如何使用operator.delslice()

项目:oil    作者:oilshell    | 项目源码 | 文件源码
def test_delslice(self):
        a = range(10)
        self.assertRaises(TypeError, operator.delslice, a)
        self.assertRaises(TypeError, operator.delslice, a, None, None)
        self.assertTrue(operator.delslice(a, 2, 8) is None)
        self.assertTrue(a == [0, 1, 8, 9])
        operator.delslice(a, 0, test_support.MAX_Py_ssize_t)
        self.assertTrue(a == [])
项目:python2-tracer    作者:extremecoders-re    | 项目源码 | 文件源码
def test_delslice(self):
        a = range(10)
        self.assertRaises(TypeError, operator.delslice, a)
        self.assertRaises(TypeError, operator.delslice, a, None, None)
        self.assertTrue(operator.delslice(a, 2, 8) is None)
        self.assertTrue(a == [0, 1, 8, 9])
        operator.delslice(a, 0, test_support.MAX_Py_ssize_t)
        self.assertTrue(a == [])
项目:pefile.pypy    作者:cloudtracer    | 项目源码 | 文件源码
def test_delslice(self):
        a = range(10)
        self.assertRaises(TypeError, operator.delslice, a)
        self.assertRaises(TypeError, operator.delslice, a, None, None)
        self.assertTrue(operator.delslice(a, 2, 8) is None)
        self.assertTrue(a == [0, 1, 8, 9])
        operator.delslice(a, 0, test_support.MAX_Py_ssize_t)
        self.assertTrue(a == [])
项目:ndk-python    作者:gittor    | 项目源码 | 文件源码
def test_delslice(self):
        a = range(10)
        self.assertRaises(TypeError, operator.delslice, a)
        self.assertRaises(TypeError, operator.delslice, a, None, None)
        self.assertTrue(operator.delslice(a, 2, 8) is None)
        self.assertTrue(a == [0, 1, 8, 9])
        operator.delslice(a, 0, test_support.MAX_Py_ssize_t)
        self.assertTrue(a == [])