From b3c03496e46ecd432984554ad575dd41485911f0 Mon Sep 17 00:00:00 2001 From: Jan Pochyla Date: Wed, 26 Oct 2016 17:33:52 +0200 Subject: [PATCH] streams: minor API change with_limit suggests that the method returns a new StreamReader, instead of mutating self. --- src/lib/streams.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/streams.py b/src/lib/streams.py index 96fa6fdf..314a7b65 100644 --- a/src/lib/streams.py +++ b/src/lib/streams.py @@ -38,13 +38,13 @@ class StreamReader: self._buffer = buf self._ofs = ofs - def with_limit(self, n): + def set_limit(self, n): ''' Makes this reader to signal EOF after reading `n` bytes. Returns the number of bytes that the reader can read after raising EOF (intended to be restored with another call to - `with_limit`). + `set_limit`). ''' if self._limit is not None: rem = self._limit - n