Coverage for typed_stream/exceptions.py: 100%

9 statements  

« prev     ^ index     » next       coverage.py v7.6.12, created at 2025-02-12 21:24 +0000

1# Licensed under the EUPL-1.2 or later. 

2# You may obtain a copy of the licence in all the official languages of the 

3# European Union at https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12 

4 

5"""Exception classes raised while handling Streams.""" 

6 

7from __future__ import annotations 

8 

9from typing import Literal 

10 

11__all__: tuple[ 

12 Literal["StreamEmptyError"], 

13 Literal["StreamFinishedError"], 

14 Literal["StreamIndexError"], 

15] = ("StreamEmptyError", "StreamFinishedError", "StreamIndexError") 

16 

17 

18class StreamFinishedError(ValueError): 

19 """You cannot perform operations on a finished Stream.""" 

20 

21 __slots__ = () 

22 

23 

24class StreamEmptyError(ValueError): 

25 """The Stream is empty.""" 

26 

27 __slots__ = () 

28 

29 

30class StreamIndexError(IndexError): 

31 """Stream index out of range.""" 

32 

33 __slots__ = ()