-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Open
Description
- Faker version: 40.1.0
- OS: Windows 11
- Python 3.13.2
Error when combining positive=True and max_value that is lower than ~0.5 (it seems to depend on the generated value).
from faker import faker
faker = Faker()
faker.pyfloat(positive=True, max_value=0.1)Error:
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\Users\User\PycharmProjects\test\.venv\Lib\site-packages\faker\providers\python\__init__.py", line 239, in pyfloat
result = result - (result - max_value + self.generator.random.uniform(0, max_value - min_value))
~~~~~~~~~~^~~~~~~~~~~
TypeError: unsupported operand type(s) for -: 'float' and 'NoneType
rodrigobnogueira
Metadata
Metadata
Assignees
Labels
No labels