Skip to content

Commit

Permalink
truer docstrings for read/write, regarding input/output types (#476)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndydeCleyre authored and henryiii committed Oct 23, 2019
1 parent 10349d1 commit 3339933
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions plumbum/path/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,13 +292,14 @@ def open(self, mode="r"):

@abstractmethod
def read(self, encoding=None):
"""returns the contents of this file. By default the data is binary (``bytes``), but you can
specify the encoding, e.g., ``'latin1'`` or ``'utf8'``"""
"""returns the contents of this file as a ``str``. By default the data is read
as text, but you can specify the encoding, e.g., ``'latin1'`` or ``'utf8'``"""

@abstractmethod
def write(self, data, encoding=None):
"""writes the given data to this file. By default the data is expected to be binary (``bytes``),
but you can specify the encoding, e.g., ``'latin1'`` or ``'utf8'``"""
"""writes the given data to this file. By default the data is written as-is
(either text or binary), but you can specify the encoding, e.g., ``'latin1'``
or ``'utf8'``"""

@abstractmethod
def touch(self):
Expand Down

0 comments on commit 3339933

Please sign in to comment.