Closed lk-geimfari closed 5 years ago
@sobolevn What do you think?
Why not? Seems like an easy feature.
I'm thinking about moving it to BaseDataProvider
too.
How it will work:
from mimesis import Person
person = Person('en')
with person.override_locale('ru'):
person.full_name()
Reasoning:
This feature is something like pull
, i.e it's useful only for locale-dependent providers.
@sobolevn Do you mind?
Agree 👍
Feature request
Thesis
So, the idea is very simple - use context manager to temporarily override current locale for provider's instance, just like that:
Reasoning
Sometimes we need only some data from other provider and creating an instance each time is not really good, so it's better just override locale.