Cannot clear bits in CallbackFlags
The status in a callback provides information on overflow and underflow issues.
Sometimes these issues are acceptable depending on how the callback wants to use the stream. For example, input underflows and overflows are acceptable in a full-duplex stream if the callback is currently only writing to outdata and thus they could be safely ignored.
It would be useful to be able to clear the bits in the CallbackFlags to indicate the that issues had been considered and deemed acceptable. At the end of processing in the callback, if any bits were still set, an error could be raised.
However, I see no way to clear specific bits in CallbackFlags.
Would you be open to a Pull Request that added setters for input_underflow, input_overflow, output_underflow, and output_overflow? Or do you see a better way to implement this?
Cheers,
Matthew
To be more specific, I'm thinking of something along these lines:

I've never thought about this.
But for completeness' sake I guess it makes sense to implement this.
Would you be open to a Pull Request that added setters for input_underflow, input_overflow, output_underflow, and output_overflow?
Yes.
But the docstring will probably not work with Sphinx, we'll have to see about this.
Or do you see a better way to implement this?
I think the way you suggested is the most straightforward one.
Theoretically, the repetition could be reduced a bit by using a metaclass, but I don't think that's worth it in this case. But I really don't have any experience with metaclasses, so I don't know.
It could probably also be implemented with __getattr__ (or __get__ and __set__?), but this would be harder to understand and harder to document with Sphinx.