def comments(self, value: Sequence[str]): """Setter for the **self.comments** property.""" attest( is_iterable(value), f'"comments" property: "{value}" must be a sequence!', ) self._comments = list(value)
def test_is_iterable(self): """ Tests :func:`colour.utilities.common.is_iterable` definition. """ self.assertTrue(is_iterable('')) self.assertTrue(is_iterable(())) self.assertTrue(is_iterable([])) self.assertTrue(is_iterable(dict())) self.assertTrue(is_iterable(set())) self.assertTrue(is_iterable(np.array([]))) self.assertFalse(is_iterable(1)) self.assertFalse(is_iterable(2)) generator = (a for a in range(10)) self.assertTrue(is_iterable(generator)) self.assertEqual(len(list(generator)), 10)
def test_is_iterable(self): """ Tests :func:`colour.utilities.common.is_iterable` definition. """ self.assertTrue(is_iterable('')) self.assertTrue(is_iterable(())) self.assertTrue(is_iterable([])) self.assertTrue(is_iterable(dict())) self.assertTrue(is_iterable(set())) self.assertTrue(is_iterable(np.array([]))) self.assertFalse(is_iterable(1)) self.assertFalse(is_iterable(2)) generator = (a for a in range(10)) self.assertTrue(is_iterable(generator)) self.assertEqual(len(list(generator)), 10)
def test_is_iterable(self): """ Tests :func:`colour.utilities.common.is_iterable` definition. """ self.assertTrue(is_iterable('')) self.assertTrue(is_iterable(())) self.assertTrue(is_iterable([])) self.assertTrue(is_iterable(dict())) self.assertTrue(is_iterable(np.array([]))) self.assertFalse(is_iterable(1)) self.assertFalse(is_iterable(2))
def test_is_iterable(self): """ Tests :func:`colour.utilities.common.is_iterable` definition. """ self.assertTrue(is_iterable('')) self.assertTrue(is_iterable(())) self.assertTrue(is_iterable([])) self.assertTrue(is_iterable(dict())) self.assertTrue(is_iterable(np.array([]))) self.assertFalse(is_iterable(1)) self.assertFalse(is_iterable(2))