diff --git a/src/uio/__init__.py b/src/uio/__init__.py index 8e9c0cb..e62c6be 100644 --- a/src/uio/__init__.py +++ b/src/uio/__init__.py @@ -14,7 +14,7 @@ This module contains ``stream`` objects that behave like files. from typing import overload, Union # TODO: MicroPython streams implement '__enter__', '__exit__', 'close', 'read', -# 'readinto', 'readline', 'write', 'flush', 'getvalue', 'seek', 'tell' +# 'readinto', 'readline', 'write', 'flush', 'seek', 'tell' # and are iterable @@ -45,6 +45,13 @@ class BytesIO: alloc_size (int): Optional number of preallocated bytes. """ + def getvalue(self) -> bytes: + """ + getvalue() -> bytes + + Gets the contents of the underlying buffer. + """ + class StringIO: @overload @@ -72,6 +79,13 @@ class StringIO: alloc_size (int): Optional number of preallocated bytes. """ + def getvalue(self) -> str: + """ + getvalue() -> str + + Gets the contents of the underlying buffer. + """ + class FileIO: """