-
Notifications
You must be signed in to change notification settings - Fork 330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed #325 #332
Fixed #325 #332
Conversation
mimesis/helpers.py
Outdated
:return: Random item of enum. | ||
""" | ||
if seed is not None: | ||
random.seed(seed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lk-geimfari heres we have some issue. When we call this function with specific seed, it always be return same value.
>>> import random
>>> random.seed(50)
>>> random.choice([1,2,3,4,5])
4
>>> random.seed(50)
>>> random.choice([1,2,3,4,5])
4
>>> random.seed(50)
>>> random.choice([1,2,3,4,5])
4
Why we cant just pass random object instance?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@duckyou We can do it. I just thought that we can do it with a minimum of changes. Create a branch from this branch with your changes, please.
* Redesign Base providers. Now for date providers we have BaseDataProvider and super class BaseProvider * BaseSpecProvider have superclass BaseProvider * BaseProvider contains seed and random object
…into duckyou-enabled_seed_enum
…into enabled_seed_enum
* Fixed spec provider seed issues * Redesigned base providers. * Added superclass BaseProvider for BaseSpecProvider * BaseProvider contains seed and random object * Fixed generic provider for seed support
…to enabled_seed_enum
Codecov Report
@@ Coverage Diff @@
## master #332 +/- ##
==========================================
- Coverage 98.83% 98.65% -0.18%
==========================================
Files 58 58
Lines 1627 1634 +7
==========================================
+ Hits 1608 1612 +4
- Misses 19 22 +3 |
…to enabled_seed_enum
No description provided.