Repository: lk-geimfari/mimesis

Issue:
Generic.reseed doesn't seem to work on internal providers
# Bug report

<!--
Hi, thanks for submitting a bug. We appreciate that.

But, we will need some information about what's wrong to help you.
-->

## What's wrong

<!-- Describe what is not working. Please, attach a traceback. -->
When using the generic provider it seems the reseed function doesn't work correctly.

```python
from mimesis import Generic
g = Generic(seed=1234)
g.address.address()

g.reseed(1234)
g.address.address()
```

Notice that the address value printed isn't the same after reseed.

## How is that should be

<!-- Describe how it should work. -->
Address printed after reseed should match address printed before.

## System information

<!-- Describe system information -->
MacOS 10.15.7
Python 3.7.10
Mimesis 4.1.3 (I know this isn't latest, but my current use case requires an older version of python)



Discussion:
Well, seems like a bug. I can offer a temporary workaround:

```python
g = Generic(seed=1234)
g.address.address()
# Output: 903 Constanso Alley
g.address.reseed(1234)
g.address.address()
# Output: 903 Constanso Alley
```

Or, something like this:

```python
class SeedGeneric(Generic):
    def reseed(self, seed: Optional[Seed] = None) -> None:
        for attr_name in self.__dir__():
            try:
                provider = getattr(self, attr_name)
                provider.reseed(seed=seed)
            except AttributeError:
                continue
                
g = SeedGeneric(seed=1234)
g.address.address()
# Output: 903 Constanso Alley
g.reseed(1234)
g.address.address()
# Output: 903 Constanso Alley
```

Resolving patch:
diff --git a/mimesis/__init__.py b/mimesis/__init__.py
--- a/mimesis/__init__.py
+++ b/mimesis/__init__.py
@@ -72,7 +72,7 @@
     "__license__",
 ]
 
-__version__ = "5.0.0"
+__version__ = "5.1.0"
 __title__ = "mimesis"
 __description__ = "Mimesis: fake data generator."
 __url__ = "https://github.com/lk-geimfari/mimesis"
diff --git a/mimesis/providers/generic.py b/mimesis/providers/generic.py
--- a/mimesis/providers/generic.py
+++ b/mimesis/providers/generic.py
@@ -112,6 +112,20 @@ def __dir__(self) -> List[str]:
                     attributes.append(a)
         return attributes
 
+    def reseed(self, seed: Optional[Seed] = None) -> None:
+        """Reseed the internal random generator.
+
+        Overrides method `BaseProvider.reseed()`.
+
+        :param seed: Seed for random.
+        """
+        for attr in self.__dir__():
+            try:
+                provider = getattr(self, attr)
+                provider.reseed(seed)
+            except AttributeError:
+                continue
+
     def add_provider(self, cls: Type[BaseProvider], **kwargs: Any) -> None:
         """Add a custom provider to Generic() object.
 


Test patch:
diff --git a/tests/test_providers/test_generic.py b/tests/test_providers/test_generic.py
--- a/tests/test_providers/test_generic.py
+++ b/tests/test_providers/test_generic.py
@@ -5,6 +5,13 @@
 
 
 class TestGeneric(object):
+    def test_reseed(self, generic):
+        generic.reseed(0xFFF)
+        address_1 = generic.address.address()
+        generic.reseed(0xFFF)
+        address_2 = generic.address.address()
+        assert address_1 == address_2
+
     def test_base_person(self, generic):
         result = generic.person.username()
         assert result is not None