Skip to content

What should happen if we start to read without starting the reader? #18

Open
@thorwhalen

Description

@thorwhalen

When revision is made we'll have:

from stream2py.examples.stream_source import SimpleCounterString

source = SimpleCounterString(start=1, stop=10)

reader = source.mk_reader()

with reader:
    print(reader.read())

Creating the reader requires the buffer to start; with reader: just increments a counter in the source to say that there is one active reader

What should happen if the user fails to enter the reader context before trying to read? should it raise an exception?

reader = source.mk_reader()
reader.read()  # should this be an error?

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions