circuitpython/tests/basics/io_stringio_base.py
Jim Mussared 4216bc7d13 tests: Replace umodule with module everywhere.
This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-06-08 17:54:24 +10:00

22 lines
365 B
Python

# Checks that an instance type inheriting from a native base that uses
# MP_TYPE_FLAG_ITER_IS_STREAM will still have a getiter.
import io
a = io.StringIO()
a.write("hello\nworld\nmicro\npython\n")
a.seek(0)
for line in a:
print(line)
class X(io.StringIO):
pass
b = X()
b.write("hello\nworld\nmicro\npython\n")
b.seek(0)
for line in b:
print(line)