2626class Settings :
2727 """Settings for the law tests.
2828
29+ This sets the context for each generated law test, by temporarily
30+ registering strategies for various types and passing any ``hypothesis``
31+ settings.
32+
2933 Any settings passed by the user will override the value from
3034 :func:`default_settings`.
3135 """
@@ -40,10 +44,11 @@ class Settings:
4044 #: of a container using:
4145 #: :func:`returns.contrib.hypothesis.containers.strategy_from_container`.
4246 container_strategy : StrategyFactory | None
43- #: Strategies for generating values of other types. This can be useful for
44- #: overriding ``TypeVar``, ``Callable``, etc. in case you use certain
45- #: types that ``hypothesis`` is unable to find.
46- other_strategies : dict [type [object ], StrategyFactory ]
47+ #: Strategies for generating values of types other than the container and
48+ #: its lawful interfaces. This can be useful for overriding ``TypeVar``,
49+ #: ``Callable``, etc. in case you use certain types that ``hypothesis`` is
50+ #: unable to find.
51+ type_strategies : dict [type [object ], StrategyFactory ]
4752
4853 def __post_init__ (self ) -> None :
4954 """Check that the settings are mutually compatible."""
@@ -61,7 +66,7 @@ def __or__(self, other: Self) -> Self:
6166 container_strategy = self .container_strategy
6267 if other .container_strategy is None
6368 else other .container_strategy ,
64- other_strategies = self .other_strategies | other .other_strategies ,
69+ type_strategies = self .type_strategies | other .type_strategies ,
6570 )
6671
6772
@@ -86,7 +91,7 @@ def default_settings(container_type: type[Lawful]) -> Settings:
8691 settings_kwargs = {},
8792 use_init = False ,
8893 container_strategy = None ,
89- other_strategies = {
94+ type_strategies = {
9095 TypeVar : type_vars_factory , # type: ignore[dict-item]
9196 Callable : pure_functions_factory , # type: ignore[dict-item]
9297 },
@@ -99,7 +104,7 @@ def check_all_laws(
99104 * ,
100105 container_strategy : StrategyFactory [Example_co ],
101106 settings_kwargs : dict [str , Any ] | None = None ,
102- other_strategies : dict [type [object ], StrategyFactory ] | None = None ,
107+ type_strategies : dict [type [object ], StrategyFactory ] | None = None ,
103108) -> None : ...
104109
105110
@@ -118,7 +123,7 @@ def check_all_laws(
118123 settings_kwargs : dict [str , Any ] | None = None ,
119124 use_init : bool = False ,
120125 container_strategy : StrategyFactory [Example_co ] | None = None ,
121- other_strategies : dict [type [object ], StrategyFactory ] | None = None ,
126+ type_strategies : dict [type [object ], StrategyFactory ] | None = None ,
122127) -> None :
123128 """
124129 Function to check all defined mathematical laws in a specified container.
@@ -150,7 +155,7 @@ def check_all_laws(
150155 settings_kwargs or {},
151156 use_init ,
152157 container_strategy ,
153- other_strategies = other_strategies or {},
158+ type_strategies = type_strategies or {},
154159 )
155160
156161 for interface , laws in container_type .laws ().items ():
@@ -282,7 +287,7 @@ def _types_to_strategies(
282287 settings : Settings ,
283288) -> dict [type [object ], StrategyFactory ]:
284289 """Return a mapping from type to `hypothesis` strategy."""
285- return settings .other_strategies | _container_mapping (
290+ return settings .type_strategies | _container_mapping (
286291 container_type , settings
287292 )
288293
0 commit comments