We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1377933 commit 370d827Copy full SHA for 370d827
1 file changed
src/thread/thread.py
@@ -507,8 +507,10 @@ def __init__(
507
length = _length
508
get_value = _get_value
509
510
- assert isinstance(length, int), '`_length` must be an integer'
511
- assert length > 0, 'dataset cannot be empty'
+ if not isinstance(length, int):
+ raise TypeError('`_length` must be an integer')
512
+ if length <= 0:
513
+ raise ValueError('dataset cannot be empty')
514
assert get_value, '`_get_value` must be set'
515
516
self._length = length
0 commit comments