diff --git a/faker/providers/color/color.py b/faker/providers/color/color.py index 47b64e0c26..756942bfb0 100644 --- a/faker/providers/color/color.py +++ b/faker/providers/color/color.py @@ -145,7 +145,7 @@ def __init__(self, generator: Optional["Generator"] = None, seed: Optional[SeedT self.random = generator.random else: self.seed = seed if seed else random.randint(0, sys.maxsize) - self.random = random.Random(self.seed) + self.random = random.Random(int(self.seed)) def generate( self, diff --git a/faker/providers/python/__init__.py b/faker/providers/python/__init__.py index 669efdad24..d601c8d4eb 100644 --- a/faker/providers/python/__init__.py +++ b/faker/providers/python/__init__.py @@ -285,7 +285,7 @@ def pydecimal( self, left_digits: Optional[int] = None, right_digits: Optional[int] = None, - positive: bool = False, + positive: Optional[bool] = None, min_value: Optional[BasicNumber] = None, max_value: Optional[BasicNumber] = None, ) -> Decimal: @@ -320,7 +320,10 @@ def pydecimal( elif max_value is not None and max_value <= 0: sign = "-" else: - sign = "+" if positive else self.random_element(("+", "-")) + if positive is None: + sign = self.random_element(("+", "-")) + else: + sign = "+" if positive else "-" if sign == "+": if max_value is not None: