From 156635f214a67c0b3cca3bb51098230a5e581a98 2013-06-27 18:14:05 From: Fernando Perez Date: 2013-06-27 18:14:05 Subject: [PATCH] Add proper docstring. --- diff --git a/IPython/utils/importstring.py b/IPython/utils/importstring.py index 03d1408..ff87e50 100644 --- a/IPython/utils/importstring.py +++ b/IPython/utils/importstring.py @@ -19,7 +19,22 @@ Authors: #----------------------------------------------------------------------------- def import_item(name): - """Import and return bar given the string foo.bar.""" + """Import and return ``bar`` given the string ``foo.bar``. + + Calling ``bar = import_item("foo.bar")`` is the functional equivalent of + executing the code ``from foo import bar``. + + Parameters + ---------- + name : string + The fully qualified name of the module/package being imported. + + Returns + ------- + mod : module object + The module that was imported. + """ + package = '.'.join(name.split('.')[0:-1]) obj = name.split('.')[-1]