GithubHelp home page GithubHelp logo

Comments (7)

lk-geimfari avatar lk-geimfari commented on June 23, 2024 1

This is probably a bug. I'll fix this. Thank you for report!

from mimesis.

lk-geimfari avatar lk-geimfari commented on June 23, 2024 1

I fixed the issue only for File, but the bug itself is still there, so I'll reopen this issue.

from mimesis.

lk-geimfari avatar lk-geimfari commented on June 23, 2024

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.

lk-geimfari avatar lk-geimfari commented on June 23, 2024

@sobolevn I apologize for the inconvenience, but do you have any eligant solution for this?

from mimesis.

Svenito avatar Svenito commented on June 23, 2024

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.

Svenito avatar Svenito commented on June 23, 2024

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.

lk-geimfari avatar lk-geimfari commented on June 23, 2024

I've fixed this bug. Thank you, @Svenito.

from mimesis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.