We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 709668a commit 14caa4bCopy full SHA for 14caa4b
1 file changed
pyvalueobjects/numbers/positive_int.py
@@ -3,11 +3,23 @@
3
4
5
class PositiveInt(PositiveOrZeroInt):
6
+ """
7
+ A value object representing a positive integer. Inherits from PositiveOrZeroInt and validates that the input is a positive integer.
8
9
10
def __init__(self, value: int):
11
12
+ Initialize the PositiveInt object with the given positive integer value.
13
+ :param value: A positive integer value.
14
15
super().__init__(value)
16
17
def _validate(self, value):
18
19
+ Validate that the given value is a positive integer.
20
+ :param value: The value to validate.
21
+ :raises: ValueObjectError if the value is not a positive integer.
22
23
super()._validate(value)
24
if value <= 0:
25
raise ValueObjectError('Value must be greater than 0.')
0 commit comments