Python operator.delslice() Examples
The following are 8
code examples of operator.delslice().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
operator
, or try the search function
.
Example #1
Source File: test_operator.py From ironpython2 with Apache License 2.0 | 5 votes |
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 == [])
Example #2
Source File: test_operator.py From BinderFilter with MIT License | 5 votes |
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 == [])
Example #3
Source File: test_operator.py From oss-ftp with MIT License | 5 votes |
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 == [])
Example #4
Source File: test_operator.py From gcblue with BSD 3-Clause "New" or "Revised" License | 5 votes |
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 == [])
Example #5
Source File: expr.py From owasp-pysec with Apache License 2.0 | 5 votes |
def __delslice__(self, key): return Expression((self, key), operator.delslice)
Example #6
Source File: test_operator.py From medicare-demo with Apache License 2.0 | 5 votes |
def test_delslice(self): a = range(10) self.failUnlessRaises(TypeError, operator.delslice, a) self.failUnlessRaises(TypeError, operator.delslice, a, None, None) self.failUnless(operator.delslice(a, 2, 8) is None) self.assert_(a == [0, 1, 8, 9]) operator.delslice(a, 0, test_support.MAX_Py_ssize_t) self.assert_(a == [])
Example #7
Source File: test_operator.py From CTFCrackTools-V2 with GNU General Public License v3.0 | 5 votes |
def test_delslice(self): a = range(10) self.failUnlessRaises(TypeError, operator.delslice, a) self.failUnlessRaises(TypeError, operator.delslice, a, None, None) self.failUnless(operator.delslice(a, 2, 8) is None) self.assert_(a == [0, 1, 8, 9]) operator.delslice(a, 0, test_support.MAX_Py_ssize_t) self.assert_(a == [])
Example #8
Source File: test_operator.py From CTFCrackTools with GNU General Public License v3.0 | 5 votes |
def test_delslice(self): a = range(10) self.failUnlessRaises(TypeError, operator.delslice, a) self.failUnlessRaises(TypeError, operator.delslice, a, None, None) self.failUnless(operator.delslice(a, 2, 8) is None) self.assert_(a == [0, 1, 8, 9]) operator.delslice(a, 0, test_support.MAX_Py_ssize_t) self.assert_(a == [])