From 33399335ee079e9ab87c02c1b0f22bf834f0c1d4 Mon Sep 17 00:00:00 2001 From: Andy Kluger Date: Wed, 23 Oct 2019 17:05:43 -0400 Subject: [PATCH] truer docstrings for read/write, regarding input/output types (#476) --- plumbum/path/base.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plumbum/path/base.py b/plumbum/path/base.py index a6545f1f3..006914a85 100644 --- a/plumbum/path/base.py +++ b/plumbum/path/base.py @@ -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):