diff --git a/core/basics.ipynb b/core/basics.ipynb index 451a891..ff1b566 100644 --- a/core/basics.ipynb +++ b/core/basics.ipynb @@ -1,7 +1,7 @@ { "metadata": { "name": "", - "signature": "sha256:4c5eb8edee509b17587401073eef999428a00c5241d92995407623e288d445f1" + "signature": "sha256:de3e7aeb6537656e464e30d624c213fb29ce962afef43280fb2d84c3a1ca1858" }, "nbformat": 3, "nbformat_minor": 0, @@ -348,7 +348,7 @@ "collapsed": false, "input": [ "%%file type_util.py\n", - "class Util:\n", + "class TypeUtil:\n", "\n", " @classmethod\n", " def is_iterable(cls, obj):\n", @@ -399,18 +399,18 @@ "input": [ "%%file tests/test_type_util.py\n", "from nose.tools import assert_equal\n", - "from pydatasnippets.core.type_util import Util\n", + "from pydatasnippets.core.type_util import TypeUtil\n", "\n", "\n", "class TestUtil():\n", "\n", " def test_is_iterable(self):\n", - " assert_equal(Util.is_iterable('foo'), True)\n", - " assert_equal(Util.is_iterable(7), False)\n", + " assert_equal(TypeUtil.is_iterable('foo'), True)\n", + " assert_equal(TypeUtil.is_iterable(7), False)\n", "\n", " def test_convert_to_list(self):\n", - " assert_equal(isinstance(Util.convert_to_list('foo'), list), True)\n", - " assert_equal(isinstance(Util.convert_to_list(7), list), False)" + " assert_equal(isinstance(TypeUtil.convert_to_list('foo'), list), True)\n", + " assert_equal(isinstance(TypeUtil.convert_to_list(7), list), False)" ], "language": "python", "metadata": {}, diff --git a/core/type_util.py b/core/type_util.py index dd5efcd..fbb848e 100644 --- a/core/type_util.py +++ b/core/type_util.py @@ -16,8 +16,8 @@ class TypeUtil: @classmethod def convert_to_list(cls, obj): - """Converts obj to a list if it is not a list and it is iterable, else - returns the original obj. + """Converts obj to a list if it is not a list and it is iterable, + else returns the original obj. """ if not isinstance(obj, list) and cls.is_iterable(obj): obj = list(obj)