Comments (7)
This is probably a bug. I'll fix this. Thank you for report!
from mimesis.
I fixed the issue only for File, but the bug itself is still there, so I'll reopen this issue.
from mimesis.
This problem requires quite a serious overhaul of some providers.
This is because some providers under the hood use other providers (for example Internet) and when the ".reseed()" method is called it reseeding only the original provider.
from mimesis.
@sobolevn I apologize for the inconvenience, but do you have any eligant solution for this?
from mimesis.
I hope you don't mind me making a couple of suggestions here:
One option would be to override the reseed
method for any class that has sub-providers, and reseed those providers there.
Another option would be to iterate over the attributes of a class in the reseed base class method, and reseed any attribute that is a subclass or instance of BaseProvider
The latter might not be as clean, but it would help prevent human error of forgetting to reseed a sub-provider. Plus only requires a change to the BaseProvider
Just some ideas to throw into the ring.
I just tested this the latest master and the issue is no longer there.
>>> g.file.file_name()
'charge.ppt'
>>> g.reseed(1)
>>> g.file.file_name()
'charge.ppt'
>>> g.reseed(1)
>>> g.file.file_name()
'charge.ppt'
>>> g.reseed(1)
>>> g.file.file_name()
'charge.ppt'
Closing issue. Thank you for looking into this
from mimesis.
Hi, I tentatively submitted a PR that reseeds all related providers on the BaseProvider.
Hopefully this is an acceptable way to solve the issue
from mimesis.
I've fixed this bug. Thank you, @Svenito.
from mimesis.
Related Issues (20)
- Generic.reseed doesn't seem to work on internal providers HOT 3
- Remove inappropriate words from email addresses HOT 4
- Datetime.datetime throws TypeError: 'Datetime' object is not callable HOT 5
- Generic provider does not have a per instance random generator. HOT 1
- Make it possible to use custom seed in custom provider HOT 3
- Fail of query_string
- Potential memory leak in Field HOT 3
- Make providers flyweight HOT 2
- US locale-based addresses include non-US street suffixes HOT 2
- Address provider function country() does not apply locale or support allow_random param HOT 2
- Reset increment HOT 6
- Mistype in person name HOT 2
- Use of underscore in examples HOT 1
- NSFW words generated by `Text.words` in `en` HOT 3
- Generating dummy country data with mimesis only returns 'United States' HOT 8
- Improve the quality of tests
- 8.0.0: pytest is failing in 34 units HOT 8
- Schema Generation from JSON HOT 3
- 9.0.0: sphinx warnings `reference target not found`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mimesis.