
On Thu, Sep 1, 2022 at 2:57 PM Jean Abou Samra <jean@abou-samra.fr> wrote:
How would a "state error" differ from this more precisely? What value would this new exception type add? Both ValueError and this proposed StateError are very generic.
Some examples: * a stream-like object that has been closed and you attempt to read from or write data to it. * a random number generator that has not been initialized with a seed (in the case where you have a constructor which doesn't also initialize it). * a hash function which you try to compute the digest without having added any data to it. In all these cases, the current call fails because a *previous* call was not done. The parameters to this invocation are not by themselves incorrect. --- Bruce