Skip to content

Commit 98f036e

Browse files
committed
Update quotes in the docs
1 parent 023d766 commit 98f036e

File tree

5 files changed

+26
-26
lines changed

5 files changed

+26
-26
lines changed

docs/examples-other/chained-factories.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ additional arguments.
1919
)
2020
2121
22-
if __name__ == '__main__':
22+
if __name__ == "__main__":
2323
instance = concrete_factory()
2424
# Same as: # instance = SomeClass(base_argument=1, extra_argument=2)
2525
@@ -43,21 +43,21 @@ Passing of the arguments works the same way like for any other :ref:`factory-pro
4343
providers.Factory(dict, arg1=1),
4444
arg2=2,
4545
)
46-
print(chained_dict_factory()) # prints: {'arg1': 1, 'arg2': 2}
46+
print(chained_dict_factory()) # prints: {"arg1": 1, "arg2": 2}
4747
4848
# 2. Keyword arguments of upper level factory have priority
4949
chained_dict_factory = providers.Factory(
5050
providers.Factory(dict, arg1=1),
5151
arg1=2,
5252
)
53-
print(chained_dict_factory()) # prints: {'arg1': 2}
53+
print(chained_dict_factory()) # prints: {"arg1": 2}
5454
5555
# 3. Keyword arguments provided from context have the most priority
5656
chained_dict_factory = providers.Factory(
5757
providers.Factory(dict, arg1=1),
5858
arg1=2,
5959
)
60-
print(chained_dict_factory(arg1=3)) # prints: {'arg1': 3}
60+
print(chained_dict_factory(arg1=3)) # prints: {"arg1": 3}
6161
6262
6363
Credits

docs/examples-other/factory-of-factories.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ additional arguments.
2020
)
2121
2222
23-
if __name__ == '__main__':
23+
if __name__ == "__main__":
2424
instance = concrete_factory()
2525
# Same as: # instance = SomeClass(base_argument=1, extra_argument=2)
2626
@@ -46,7 +46,7 @@ Passing of the arguments works the same way like for any other :ref:`factory-pro
4646
arg1=1,
4747
)
4848
dict_factory = factory_of_dict_factories(arg2=2)
49-
print(dict_factory()) # prints: {'arg1': 1, 'arg2': 2}
49+
print(dict_factory()) # prints: {"arg1": 1, "arg2": 2}
5050
5151
# 2. Keyword arguments of upper level factory have priority
5252
factory_of_dict_factories = providers.Factory(
@@ -55,7 +55,7 @@ Passing of the arguments works the same way like for any other :ref:`factory-pro
5555
arg1=1,
5656
)
5757
dict_factory = factory_of_dict_factories(arg1=2)
58-
print(dict_factory()) # prints: {'arg1': 2}
58+
print(dict_factory()) # prints: {"arg1": 2}
5959
6060
# 3. Keyword arguments provided from context have the most priority
6161
factory_of_dict_factories = providers.Factory(
@@ -64,7 +64,7 @@ Passing of the arguments works the same way like for any other :ref:`factory-pro
6464
arg1=1,
6565
)
6666
dict_factory = factory_of_dict_factories(arg1=2)
67-
print(dict_factory(arg1=3)) # prints: {'arg1': 3}
67+
print(dict_factory(arg1=3)) # prints: {"arg1": 3}
6868
6969
Credits
7070
-------

docs/providers/configuration.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ To use another loader use ``loader`` argument:
9191
import yaml
9292
9393
94-
container.config.from_yaml('config.yml', loader=yaml.UnsafeLoader)
94+
container.config.from_yaml("config.yml", loader=yaml.UnsafeLoader)
9595
9696
.. note::
9797

@@ -123,7 +123,7 @@ If you need to pass an argument to this call, use ``.from_pydantic()`` keyword a
123123

124124
.. code-block:: python
125125
126-
container.config.from_pydantic(Settings(), exclude={'optional'})
126+
container.config.from_pydantic(Settings(), exclude={"optional"})
127127
128128
.. note::
129129

@@ -225,7 +225,7 @@ undefined environment variable that doesn't have a default value, pass argument
225225

226226
.. code-block:: python
227227
228-
container.config.from_yaml('config.yml', envs_required=True)
228+
container.config.from_yaml("config.yml", envs_required=True)
229229
230230
See also: :ref:`configuration-strict-mode`.
231231

@@ -270,13 +270,13 @@ Mandatory YAML file:
270270

271271
.. code-block:: python
272272
273-
container.config.from_yaml('config.yaml', required=True)
273+
container.config.from_yaml("config.yaml", required=True)
274274
275275
Mandatory INI file:
276276

277277
.. code-block:: python
278278
279-
container.config.from_ini('config.ini', required=True)
279+
container.config.from_ini("config.ini", required=True)
280280
281281
Mandatory dictionary:
282282

@@ -288,7 +288,7 @@ Mandatory environment variable:
288288

289289
.. code-block:: python
290290
291-
container.config.api_key.from_env('API_KEY', required=True)
291+
container.config.api_key.from_env("API_KEY", required=True)
292292
293293
See also: :ref:`configuration-strict-mode`.
294294

@@ -346,16 +346,16 @@ configuration data is undefined:
346346
config = providers.Configuration(strict=True)
347347
348348
349-
if __name__ == '__main__':
349+
if __name__ == "__main__":
350350
container = Container()
351351
352352
try:
353-
container.config.from_yaml('does-not_exist.yml') # raise exception
353+
container.config.from_yaml("does-not_exist.yml") # raise exception
354354
except FileNotFoundError:
355355
...
356356
357357
try:
358-
container.config.from_ini('does-not_exist.ini') # raise exception
358+
container.config.from_ini("does-not_exist.ini") # raise exception
359359
except FileNotFoundError:
360360
...
361361
@@ -365,7 +365,7 @@ configuration data is undefined:
365365
...
366366
367367
try:
368-
container.config.from_env('UNDEFINED_ENV_VAR') # raise exception
368+
container.config.from_env("UNDEFINED_ENV_VAR") # raise exception
369369
except ValueError:
370370
...
371371
@@ -385,7 +385,7 @@ an undefined environment variable without a default value.
385385
.. code-block:: python
386386
387387
try:
388-
container.config.from_yaml('undefined_env.yml') # raise exception
388+
container.config.from_yaml("undefined_env.yml") # raise exception
389389
except ValueError:
390390
...
391391
@@ -398,11 +398,11 @@ You can override ``.from_*()`` methods behaviour in strict mode using ``required
398398
config = providers.Configuration(strict=True)
399399
400400
401-
if __name__ == '__main__':
401+
if __name__ == "__main__":
402402
container = Container()
403403
404-
container.config.from_yaml('config.yml')
405-
container.config.from_yaml('config.local.yml', required=False)
404+
container.config.from_yaml("config.yml")
405+
container.config.from_yaml("config.local.yml", required=False)
406406
407407
You can also use ``.required()`` option modifier when making an injection. It does not require to switch
408408
configuration provider to strict mode.

docs/providers/dict.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ To use non-string keys or keys with ``.`` and ``-`` provide a dictionary as a po
2323
2424
providers.Dict({
2525
SomeClass: providers.Factory(...),
26-
'key.with.periods': providers.Factory(...),
27-
'key-with-dashes': providers.Factory(...),
26+
"key.with.periods": providers.Factory(...),
27+
"key-with-dashes": providers.Factory(...),
2828
})
2929
3030
Example:

docs/providers/typing_mypy.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ IDE.
3030
provider = providers.Factory(Cat)
3131
3232
33-
if __name__ == '__main__':
33+
if __name__ == "__main__":
3434
animal = provider() # mypy knows that animal is of type "Cat"
3535
3636
@@ -54,5 +54,5 @@ function or method.
5454
provider: providers.Provider[Animal] = providers.Factory(Cat)
5555
5656
57-
if __name__ == '__main__':
57+
if __name__ == "__main__":
5858
animal = provider() # mypy knows that animal is of type "Animal"

0 commit comments

Comments
 (0)