Skip to content

Commit

Permalink
Merge pull request #654 from jbarnoud/issue-649-docstring
Browse files Browse the repository at this point in the history
Issue 649 docstring
  • Loading branch information
richardjgowers committed Jan 22, 2016
2 parents 5dc4fde + c707b59 commit 848aedf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions package/MDAnalysis/lib/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,8 @@ class NamedStream(io.IOBase):
The class can be used as a context manager.
:class:`NamedStream` is derived from :class:`io.IOBase` (to indicate that
it is a stream) *and* :class:`basestring` (that one can use
:func:`iterable` in the same way as for strings).
it is a stream); some operations that normally expect a string will also
work with a :class:`NamedStream`.
.. rubric:: Example
Expand Down Expand Up @@ -824,7 +824,8 @@ def guess_format(filename):


def iterable(obj):
"""Returns ``True`` if *obj* can be iterated over and is *not* a string."""
"""Returns ``True`` if *obj* can be iterated over and is *not* a string
nor a :class:`NamedStream`"""
if isinstance(obj, (basestring, NamedStream)):
return False # avoid iterating over characters of a string

Expand Down

0 comments on commit 848aedf

Please sign in to comment.