We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
`validates_with_beartype` considers `Partial` as `NoneType`
Hi @rsokl. I was having a blast using this fascinating library. But It seems when used with `hydra_zen.third_party.validates_with_beartype`, it casts `hydra_zen.typing.Partial` as `NoneType`. 


```python
from hydra_zen.typing import Partial
from hydra_zen.third_party.beartype import validates_with_beartype


def f(x: Partial[list]):
    return x


val_f = validates_with_beartype(f)

val_f(3)
```

It raises the following error. Can you take a look?

```bash
beartype.roar.BeartypeCallHintParamViolation: @beartyped __main__.f() 
parameter x=3 violates type hint None, as int 3 not instance of <class "builtins.NoneType">.
```

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `src/hydra_zen/typing/_implementations.py`
Content:
```
1 # Copyright (c) 2022 Massachusetts Institute of Technology
2 # SPDX-License-Identifier: MIT
3 
4 # pyright: strict
5 
6 import sys
7 import types
8 from enum import Enum
9 from pathlib import Path, PosixPath, WindowsPath
10 from typing import (
11     TYPE_CHECKING,
12     Any,
13     ByteString,
14     Callable,
15     ClassVar,
16     Dict,
17     FrozenSet,
18     Generic,
19     List,
20     Mapping,
21     NewType,
22     Optional,
23     Sequence,
24     Set,
25     Tuple,
26     Type,
27     TypeVar,
28     Union,
29 )
30 
31 from omegaconf import DictConfig, ListConfig
32 from typing_extensions import (
33     Final,
34     Literal,
35     ParamSpec,
36     Protocol,
37     Self,
38     TypeAlias,
39     TypedDict,
40     runtime_checkable,
41 )
42 
43 __all__ = [
44     "Just",
45     "Builds",
46     "PartialBuilds",
47     "Partial",
48     "Importable",
49     "SupportedPrimitive",
50     "ZenWrappers",
51     "ZenPartialBuilds",
52     "HydraPartialBuilds",
53     "ZenConvert",
54 ]
55 
56 P = ParamSpec("P")
57 R = TypeVar("R")
58 
59 
60 class EmptyDict(TypedDict):
61     pass
62 
63 
64 T = TypeVar("T", covariant=True)
65 T2 = TypeVar("T2")
66 T3 = TypeVar("T3")
67 
68 T4 = TypeVar("T4", bound=Callable[..., Any])
69 
70 
71 InstOrType: TypeAlias = Union[T, Type[T]]
72 
73 
74 if TYPE_CHECKING:
75     from dataclasses import Field  # provided by typestub but not generic at runtime
76 else:
77 
78     class Field(Protocol[T2]):
79         name: str
80         type: Type[T2]
81         default: T2
82         default_factory: Callable[[], T2]
83         repr: bool
84         hash: Optional[bool]
85         init: bool
86         compare: bool
87         metadata: Mapping[str, Any]
88 
89 
90 @runtime_checkable
91 class Partial(Protocol[T2]):
92     __call__: Callable[..., T2]
93 
94     @property
95     def func(self) -> Callable[..., T2]:
96         ...
97 
98     @property
99     def args(self) -> Tuple[Any, ...]:
100         ...
101 
102     @property
103     def keywords(self) -> Dict[str, Any]:
104         ...
105 
106     def __new__(
107         cls: Type[Self], __func: Callable[..., T2], *args: Any, **kwargs: Any
108     ) -> Self:
109         ...
110 
111     if sys.version_info >= (3, 9):  # pragma: no cover
112 
113         def __class_getitem__(cls, item: Any) -> types.GenericAlias:
114             ...
115 
116 
117 InterpStr = NewType("InterpStr", str)
118 
119 
120 class DataClass_(Protocol):
121     # doesn't provide __init__, __getattribute__, etc.
122     __dataclass_fields__: ClassVar[Dict[str, Field[Any]]]
123 
124 
125 class DataClass(DataClass_, Protocol):
126     def __init__(self, *args: Any, **kwargs: Any) -> None:
127         ...
128 
129     def __getattribute__(self, __name: str) -> Any:
130         ...
131 
132     def __setattr__(self, __name: str, __value: Any) -> None:
133         ...
134 
135 
136 @runtime_checkable
137 class Builds(DataClass, Protocol[T]):
138     _target_: ClassVar[str]
139 
140 
141 class BuildsWithSig(Builds[T], Protocol[T, P]):
142     def __init__(self, *args: P.args, **kwds: P.kwargs):
143         ...
144 
145 
146 @runtime_checkable
147 class Just(Builds[T], Protocol[T]):
148     path: ClassVar[str]  # interpolated string for importing obj
149     _target_: ClassVar[Literal["hydra_zen.funcs.get_obj"]] = "hydra_zen.funcs.get_obj"
150 
151 
152 class ZenPartialMixin(Protocol[T]):
153     _zen_target: ClassVar[str]
154     _zen_partial: ClassVar[Literal[True]] = True
155 
156 
157 class HydraPartialMixin(Protocol[T]):
158     _partial_: ClassVar[Literal[True]] = True
159 
160 
161 @runtime_checkable
162 class ZenPartialBuilds(Builds[T], ZenPartialMixin[T], Protocol[T]):
163     _target_: ClassVar[
164         Literal["hydra_zen.funcs.zen_processing"]
165     ] = "hydra_zen.funcs.zen_processing"
166 
167 
168 @runtime_checkable
169 class HydraPartialBuilds(Builds[T], HydraPartialMixin[T], Protocol[T]):
170     ...
171 
172 
173 # Necessary, but not sufficient, check for PartialBuilds; useful for creating
174 # non-overlapping overloads
175 IsPartial: TypeAlias = Union[ZenPartialMixin[T], HydraPartialMixin[T]]
176 
177 PartialBuilds: TypeAlias = Union[ZenPartialBuilds[T], HydraPartialBuilds[T]]
178 
179 
180 @runtime_checkable
181 class HasTarget(Protocol):
182     _target_: str
183 
184 
185 Importable = TypeVar("Importable", bound=Callable[..., Any])
186 
187 _HydraPrimitive: TypeAlias = Union[
188     bool, None, int, float, str, ByteString, Path, WindowsPath, PosixPath
189 ]
190 
191 _SupportedViaBuilds = Union[
192     Partial[Any],
193     range,
194     Set[Any],
195 ]
196 
197 _SupportedPrimitive: TypeAlias = Union[
198     _HydraPrimitive,
199     ListConfig,
200     DictConfig,
201     Callable[..., Any],
202     Enum,
203     DataClass_,
204     complex,
205     _SupportedViaBuilds,
206     EmptyDict,  # not covered by Mapping[..., ...]]
207 ]
208 
209 if TYPE_CHECKING:
210     SupportedPrimitive: TypeAlias = Union[
211         _SupportedPrimitive,
212         FrozenSet["SupportedPrimitive"],
213         # Even thought this is redundant with Sequence, it seems to
214         # be needed for pyright to do proper checking of tuple contents
215         Tuple["SupportedPrimitive", ...],
216         # Mutable generic containers need to be invariant, so
217         # we have to settle for Sequence/Mapping. While this
218         # is overly permissive in terms of sequence-type, it
219         # at least affords quality checking of sequence content
220         Sequence["SupportedPrimitive"],
221         # Mapping is covariant only in value
222         Mapping[Any, "SupportedPrimitive"],
223     ]
224 else:
225     # cleans up annotations for REPLs
226     SupportedPrimitive = TypeVar("SupportedPrimitive")
227 
228 
229 ZenWrapper: TypeAlias = Union[
230     None,
231     Builds[Callable[[T4], T4]],
232     PartialBuilds[Callable[[T4], T4]],
233     Just[Callable[[T4], T4]],
234     Type[Builds[Callable[[T4], T4]]],
235     Type[PartialBuilds[Callable[[T4], T4]]],
236     Type[Just[Callable[[T4], T4]]],
237     Callable[[T4], T4],
238     str,
239 ]
240 if TYPE_CHECKING:
241     ZenWrappers: TypeAlias = Union[ZenWrapper[T4], Sequence[ZenWrapper[T4]]]
242 else:
243     # cleans up annotations for REPLs
244     class ZenWrappers(Generic[T2]):  # pragma: no cover
245         pass
246 
247 
248 DefaultsList = List[
249     Union[str, DataClass_, Mapping[str, Union[None, str, Sequence[str]]]]
250 ]
251 
252 
253 # Lists all zen-convert settings and their types. Not part of public API
254 class AllConvert(TypedDict, total=True):
255     dataclass: bool
256 
257 
258 # used for runtime type-checking
259 convert_types: Final = {"dataclass": bool}
260 
261 GroupName: TypeAlias = Optional[str]
262 NodeName: TypeAlias = str
263 Node: TypeAlias = Any
264 
265 
266 # TODO: make immutable
267 class StoreEntry(TypedDict):
268     name: NodeName
269     group: GroupName
270     package: Optional[str]
271     provider: Optional[str]
272     node: Node
273 
274 
275 class ZenConvert(TypedDict, total=False):
276     """A TypedDict that provides a type-checked interface for specifying zen-convert
277     options that configure the hydra-zen config-creation functions (e.g., `builds`,
278     `just`, and `make_config`).
279 
280     Note that, at runtime, `ZenConvert` is simply a dictionary with type-annotations. There is no enforced runtime validation of its keys and values.
281 
282     Parameters
283     ----------
284     dataclass : bool
285         If `True` any dataclass type/instance without a `_target_` field is
286         automatically converted to a targeted config that will instantiate to that type/
287         instance. Otherwise the dataclass type/instance will be passed through as-is.
288 
289         Note that this only works with statically-defined dataclass types, whereas
290         :func:`~hydra_zen.make_config` and :py:func:`dataclasses.make_dataclass`
291         dynamically generate dataclass types. Additionally, this feature is not
292         compatible with a dataclass instance whose type possesses an `InitVar` field.
293 
294     Examples
295     --------
296     >>> from hydra_zen.typing import ZenConvert as zc
297     >>> zc()
298     {}
299     >>> zc(dataclass=True)
300     {"dataclass": True}
301     >>> # static type-checker will raise, but runtime will not
302     >>> zc(apple=1)  # type: ignore
303     {"apple": 1}
304 
305     **Configuring dataclass auto-config behaviors**
306 
307     >>> from hydra_zen import instantiate as I
308     >>> from hydra_zen import builds, just
309     >>> from dataclasses import dataclass
310     >>> @dataclass
311     ... class B:
312     ...     x: int
313     >>> b = B(x=1)
314 
315     >>> I(just(b))
316     B(x=1)
317     >>> I(just(b, zen_convert=zc(dataclass=False)))  # returns omegaconf.DictConfig
318     {"x": 1}
319 
320     >>> I(builds(dict, y=b))
321     {'y': B(x=1)}
322     >>> I(builds(dict, y=b, zen_convert=zc(dataclass=False)))  # returns omegaconf.DictConfig
323     {'y': {'x': 1}}
324 
325     >>> I(make_config(y=b))  # returns omegaconf.DictConfig
326     {'y': {'x': 1}}
327     >>> I(make_config(y=b, zen_convert=zc(dataclass=True), hydra_convert="all"))
328     {'y': B(x=1)}
329 
330     Auto-config support does not work with dynamically-generated dataclass types
331 
332     >>> just(make_config(z=1))
333     HydraZenUnsupportedPrimitiveError: ...
334     >>> I(just(make_config(z=1), zen_convert=zc(dataclass=False)))
335     {'z': 1}
336 
337     A dataclass with a `_target_` field will not be converted:
338 
339     >>> @dataclass
340     ... class BuildsStr:
341     ...     _target_: str = 'builtins.str'
342     ...
343     >>> BuildsStr is just(BuildsStr)
344     True
345     >>> (builds_str := BuildsStr()) is just(builds_str)
346     True
347     """
348 
349     dataclass: bool
350
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/src/hydra_zen/typing/_implementations.py b/src/hydra_zen/typing/_implementations.py
--- a/src/hydra_zen/typing/_implementations.py
+++ b/src/hydra_zen/typing/_implementations.py
@@ -108,7 +108,7 @@
     ) -> Self:
         ...
 
-    if sys.version_info >= (3, 9):  # pragma: no cover
+    if TYPE_CHECKING and sys.version_info >= (3, 9):  # pragma: no cover
 
         def __class_getitem__(cls, item: Any) -> types.GenericAlias:
             ...

{"golden_diff": "diff --git a/src/hydra_zen/typing/_implementations.py b/src/hydra_zen/typing/_implementations.py\n--- a/src/hydra_zen/typing/_implementations.py\n+++ b/src/hydra_zen/typing/_implementations.py\n@@ -108,7 +108,7 @@\n     ) -> Self:\n         ...\n \n-    if sys.version_info >= (3, 9):  # pragma: no cover\n+    if TYPE_CHECKING and sys.version_info >= (3, 9):  # pragma: no cover\n \n         def __class_getitem__(cls, item: Any) -> types.GenericAlias:\n             ...\n", "issue": "`validates_with_beartype` considers `Partial` as `NoneType`\nHi @rsokl. I was having a blast using this fascinating library. But It seems when used with `hydra_zen.third_party.validates_with_beartype`, it casts `hydra_zen.typing.Partial` as `NoneType`. \r\n\r\n\r\n```python\r\nfrom hydra_zen.typing import Partial\r\nfrom hydra_zen.third_party.beartype import validates_with_beartype\r\n\r\n\r\ndef f(x: Partial[list]):\r\n    return x\r\n\r\n\r\nval_f = validates_with_beartype(f)\r\n\r\nval_f(3)\r\n```\r\n\r\nIt raises the following error. Can you take a look?\r\n\r\n```bash\r\nbeartype.roar.BeartypeCallHintParamViolation: @beartyped __main__.f() \r\nparameter x=3 violates type hint None, as int 3 not instance of <class \"builtins.NoneType\">.\r\n```\n", "before_files": [{"content": "# Copyright (c) 2022 Massachusetts Institute of Technology\n# SPDX-License-Identifier: MIT\n\n# pyright: strict\n\nimport sys\nimport types\nfrom enum import Enum\nfrom pathlib import Path, PosixPath, WindowsPath\nfrom typing import (\n    TYPE_CHECKING,\n    Any,\n    ByteString,\n    Callable,\n    ClassVar,\n    Dict,\n    FrozenSet,\n    Generic,\n    List,\n    Mapping,\n    NewType,\n    Optional,\n    Sequence,\n    Set,\n    Tuple,\n    Type,\n    TypeVar,\n    Union,\n)\n\nfrom omegaconf import DictConfig, ListConfig\nfrom typing_extensions import (\n    Final,\n    Literal,\n    ParamSpec,\n    Protocol,\n    Self,\n    TypeAlias,\n    TypedDict,\n    runtime_checkable,\n)\n\n__all__ = [\n    \"Just\",\n    \"Builds\",\n    \"PartialBuilds\",\n    \"Partial\",\n    \"Importable\",\n    \"SupportedPrimitive\",\n    \"ZenWrappers\",\n    \"ZenPartialBuilds\",\n    \"HydraPartialBuilds\",\n    \"ZenConvert\",\n]\n\nP = ParamSpec(\"P\")\nR = TypeVar(\"R\")\n\n\nclass EmptyDict(TypedDict):\n    pass\n\n\nT = TypeVar(\"T\", covariant=True)\nT2 = TypeVar(\"T2\")\nT3 = TypeVar(\"T3\")\n\nT4 = TypeVar(\"T4\", bound=Callable[..., Any])\n\n\nInstOrType: TypeAlias = Union[T, Type[T]]\n\n\nif TYPE_CHECKING:\n    from dataclasses import Field  # provided by typestub but not generic at runtime\nelse:\n\n    class Field(Protocol[T2]):\n        name: str\n        type: Type[T2]\n        default: T2\n        default_factory: Callable[[], T2]\n        repr: bool\n        hash: Optional[bool]\n        init: bool\n        compare: bool\n        metadata: Mapping[str, Any]\n\n\n@runtime_checkable\nclass Partial(Protocol[T2]):\n    __call__: Callable[..., T2]\n\n    @property\n    def func(self) -> Callable[..., T2]:\n        ...\n\n    @property\n    def args(self) -> Tuple[Any, ...]:\n        ...\n\n    @property\n    def keywords(self) -> Dict[str, Any]:\n        ...\n\n    def __new__(\n        cls: Type[Self], __func: Callable[..., T2], *args: Any, **kwargs: Any\n    ) -> Self:\n        ...\n\n    if sys.version_info >= (3, 9):  # pragma: no cover\n\n        def __class_getitem__(cls, item: Any) -> types.GenericAlias:\n            ...\n\n\nInterpStr = NewType(\"InterpStr\", str)\n\n\nclass DataClass_(Protocol):\n    # doesn't provide __init__, __getattribute__, etc.\n    __dataclass_fields__: ClassVar[Dict[str, Field[Any]]]\n\n\nclass DataClass(DataClass_, Protocol):\n    def __init__(self, *args: Any, **kwargs: Any) -> None:\n        ...\n\n    def __getattribute__(self, __name: str) -> Any:\n        ...\n\n    def __setattr__(self, __name: str, __value: Any) -> None:\n        ...\n\n\n@runtime_checkable\nclass Builds(DataClass, Protocol[T]):\n    _target_: ClassVar[str]\n\n\nclass BuildsWithSig(Builds[T], Protocol[T, P]):\n    def __init__(self, *args: P.args, **kwds: P.kwargs):\n        ...\n\n\n@runtime_checkable\nclass Just(Builds[T], Protocol[T]):\n    path: ClassVar[str]  # interpolated string for importing obj\n    _target_: ClassVar[Literal[\"hydra_zen.funcs.get_obj\"]] = \"hydra_zen.funcs.get_obj\"\n\n\nclass ZenPartialMixin(Protocol[T]):\n    _zen_target: ClassVar[str]\n    _zen_partial: ClassVar[Literal[True]] = True\n\n\nclass HydraPartialMixin(Protocol[T]):\n    _partial_: ClassVar[Literal[True]] = True\n\n\n@runtime_checkable\nclass ZenPartialBuilds(Builds[T], ZenPartialMixin[T], Protocol[T]):\n    _target_: ClassVar[\n        Literal[\"hydra_zen.funcs.zen_processing\"]\n    ] = \"hydra_zen.funcs.zen_processing\"\n\n\n@runtime_checkable\nclass HydraPartialBuilds(Builds[T], HydraPartialMixin[T], Protocol[T]):\n    ...\n\n\n# Necessary, but not sufficient, check for PartialBuilds; useful for creating\n# non-overlapping overloads\nIsPartial: TypeAlias = Union[ZenPartialMixin[T], HydraPartialMixin[T]]\n\nPartialBuilds: TypeAlias = Union[ZenPartialBuilds[T], HydraPartialBuilds[T]]\n\n\n@runtime_checkable\nclass HasTarget(Protocol):\n    _target_: str\n\n\nImportable = TypeVar(\"Importable\", bound=Callable[..., Any])\n\n_HydraPrimitive: TypeAlias = Union[\n    bool, None, int, float, str, ByteString, Path, WindowsPath, PosixPath\n]\n\n_SupportedViaBuilds = Union[\n    Partial[Any],\n    range,\n    Set[Any],\n]\n\n_SupportedPrimitive: TypeAlias = Union[\n    _HydraPrimitive,\n    ListConfig,\n    DictConfig,\n    Callable[..., Any],\n    Enum,\n    DataClass_,\n    complex,\n    _SupportedViaBuilds,\n    EmptyDict,  # not covered by Mapping[..., ...]]\n]\n\nif TYPE_CHECKING:\n    SupportedPrimitive: TypeAlias = Union[\n        _SupportedPrimitive,\n        FrozenSet[\"SupportedPrimitive\"],\n        # Even thought this is redundant with Sequence, it seems to\n        # be needed for pyright to do proper checking of tuple contents\n        Tuple[\"SupportedPrimitive\", ...],\n        # Mutable generic containers need to be invariant, so\n        # we have to settle for Sequence/Mapping. While this\n        # is overly permissive in terms of sequence-type, it\n        # at least affords quality checking of sequence content\n        Sequence[\"SupportedPrimitive\"],\n        # Mapping is covariant only in value\n        Mapping[Any, \"SupportedPrimitive\"],\n    ]\nelse:\n    # cleans up annotations for REPLs\n    SupportedPrimitive = TypeVar(\"SupportedPrimitive\")\n\n\nZenWrapper: TypeAlias = Union[\n    None,\n    Builds[Callable[[T4], T4]],\n    PartialBuilds[Callable[[T4], T4]],\n    Just[Callable[[T4], T4]],\n    Type[Builds[Callable[[T4], T4]]],\n    Type[PartialBuilds[Callable[[T4], T4]]],\n    Type[Just[Callable[[T4], T4]]],\n    Callable[[T4], T4],\n    str,\n]\nif TYPE_CHECKING:\n    ZenWrappers: TypeAlias = Union[ZenWrapper[T4], Sequence[ZenWrapper[T4]]]\nelse:\n    # cleans up annotations for REPLs\n    class ZenWrappers(Generic[T2]):  # pragma: no cover\n        pass\n\n\nDefaultsList = List[\n    Union[str, DataClass_, Mapping[str, Union[None, str, Sequence[str]]]]\n]\n\n\n# Lists all zen-convert settings and their types. Not part of public API\nclass AllConvert(TypedDict, total=True):\n    dataclass: bool\n\n\n# used for runtime type-checking\nconvert_types: Final = {\"dataclass\": bool}\n\nGroupName: TypeAlias = Optional[str]\nNodeName: TypeAlias = str\nNode: TypeAlias = Any\n\n\n# TODO: make immutable\nclass StoreEntry(TypedDict):\n    name: NodeName\n    group: GroupName\n    package: Optional[str]\n    provider: Optional[str]\n    node: Node\n\n\nclass ZenConvert(TypedDict, total=False):\n    \"\"\"A TypedDict that provides a type-checked interface for specifying zen-convert\n    options that configure the hydra-zen config-creation functions (e.g., `builds`,\n    `just`, and `make_config`).\n\n    Note that, at runtime, `ZenConvert` is simply a dictionary with type-annotations. There is no enforced runtime validation of its keys and values.\n\n    Parameters\n    ----------\n    dataclass : bool\n        If `True` any dataclass type/instance without a `_target_` field is\n        automatically converted to a targeted config that will instantiate to that type/\n        instance. Otherwise the dataclass type/instance will be passed through as-is.\n\n        Note that this only works with statically-defined dataclass types, whereas\n        :func:`~hydra_zen.make_config` and :py:func:`dataclasses.make_dataclass`\n        dynamically generate dataclass types. Additionally, this feature is not\n        compatible with a dataclass instance whose type possesses an `InitVar` field.\n\n    Examples\n    --------\n    >>> from hydra_zen.typing import ZenConvert as zc\n    >>> zc()\n    {}\n    >>> zc(dataclass=True)\n    {\"dataclass\": True}\n    >>> # static type-checker will raise, but runtime will not\n    >>> zc(apple=1)  # type: ignore\n    {\"apple\": 1}\n\n    **Configuring dataclass auto-config behaviors**\n\n    >>> from hydra_zen import instantiate as I\n    >>> from hydra_zen import builds, just\n    >>> from dataclasses import dataclass\n    >>> @dataclass\n    ... class B:\n    ...     x: int\n    >>> b = B(x=1)\n\n    >>> I(just(b))\n    B(x=1)\n    >>> I(just(b, zen_convert=zc(dataclass=False)))  # returns omegaconf.DictConfig\n    {\"x\": 1}\n\n    >>> I(builds(dict, y=b))\n    {'y': B(x=1)}\n    >>> I(builds(dict, y=b, zen_convert=zc(dataclass=False)))  # returns omegaconf.DictConfig\n    {'y': {'x': 1}}\n\n    >>> I(make_config(y=b))  # returns omegaconf.DictConfig\n    {'y': {'x': 1}}\n    >>> I(make_config(y=b, zen_convert=zc(dataclass=True), hydra_convert=\"all\"))\n    {'y': B(x=1)}\n\n    Auto-config support does not work with dynamically-generated dataclass types\n\n    >>> just(make_config(z=1))\n    HydraZenUnsupportedPrimitiveError: ...\n    >>> I(just(make_config(z=1), zen_convert=zc(dataclass=False)))\n    {'z': 1}\n\n    A dataclass with a `_target_` field will not be converted:\n\n    >>> @dataclass\n    ... class BuildsStr:\n    ...     _target_: str = 'builtins.str'\n    ...\n    >>> BuildsStr is just(BuildsStr)\n    True\n    >>> (builds_str := BuildsStr()) is just(builds_str)\n    True\n    \"\"\"\n\n    dataclass: bool\n", "path": "src/hydra_zen/typing/_implementations.py"}], "after_files": [{"content": "# Copyright (c) 2022 Massachusetts Institute of Technology\n# SPDX-License-Identifier: MIT\n\n# pyright: strict\n\nimport sys\nimport types\nfrom enum import Enum\nfrom pathlib import Path, PosixPath, WindowsPath\nfrom typing import (\n    TYPE_CHECKING,\n    Any,\n    ByteString,\n    Callable,\n    ClassVar,\n    Dict,\n    FrozenSet,\n    Generic,\n    List,\n    Mapping,\n    NewType,\n    Optional,\n    Sequence,\n    Set,\n    Tuple,\n    Type,\n    TypeVar,\n    Union,\n)\n\nfrom omegaconf import DictConfig, ListConfig\nfrom typing_extensions import (\n    Final,\n    Literal,\n    ParamSpec,\n    Protocol,\n    Self,\n    TypeAlias,\n    TypedDict,\n    runtime_checkable,\n)\n\n__all__ = [\n    \"Just\",\n    \"Builds\",\n    \"PartialBuilds\",\n    \"Partial\",\n    \"Importable\",\n    \"SupportedPrimitive\",\n    \"ZenWrappers\",\n    \"ZenPartialBuilds\",\n    \"HydraPartialBuilds\",\n    \"ZenConvert\",\n]\n\nP = ParamSpec(\"P\")\nR = TypeVar(\"R\")\n\n\nclass EmptyDict(TypedDict):\n    pass\n\n\nT = TypeVar(\"T\", covariant=True)\nT2 = TypeVar(\"T2\")\nT3 = TypeVar(\"T3\")\n\nT4 = TypeVar(\"T4\", bound=Callable[..., Any])\n\n\nInstOrType: TypeAlias = Union[T, Type[T]]\n\n\nif TYPE_CHECKING:\n    from dataclasses import Field  # provided by typestub but not generic at runtime\nelse:\n\n    class Field(Protocol[T2]):\n        name: str\n        type: Type[T2]\n        default: T2\n        default_factory: Callable[[], T2]\n        repr: bool\n        hash: Optional[bool]\n        init: bool\n        compare: bool\n        metadata: Mapping[str, Any]\n\n\n@runtime_checkable\nclass Partial(Protocol[T2]):\n    __call__: Callable[..., T2]\n\n    @property\n    def func(self) -> Callable[..., T2]:\n        ...\n\n    @property\n    def args(self) -> Tuple[Any, ...]:\n        ...\n\n    @property\n    def keywords(self) -> Dict[str, Any]:\n        ...\n\n    def __new__(\n        cls: Type[Self], __func: Callable[..., T2], *args: Any, **kwargs: Any\n    ) -> Self:\n        ...\n\n    if TYPE_CHECKING and sys.version_info >= (3, 9):  # pragma: no cover\n\n        def __class_getitem__(cls, item: Any) -> types.GenericAlias:\n            ...\n\n\nInterpStr = NewType(\"InterpStr\", str)\n\n\nclass DataClass_(Protocol):\n    # doesn't provide __init__, __getattribute__, etc.\n    __dataclass_fields__: ClassVar[Dict[str, Field[Any]]]\n\n\nclass DataClass(DataClass_, Protocol):\n    def __init__(self, *args: Any, **kwargs: Any) -> None:\n        ...\n\n    def __getattribute__(self, __name: str) -> Any:\n        ...\n\n    def __setattr__(self, __name: str, __value: Any) -> None:\n        ...\n\n\n@runtime_checkable\nclass Builds(DataClass, Protocol[T]):\n    _target_: ClassVar[str]\n\n\nclass BuildsWithSig(Builds[T], Protocol[T, P]):\n    def __init__(self, *args: P.args, **kwds: P.kwargs):\n        ...\n\n\n@runtime_checkable\nclass Just(Builds[T], Protocol[T]):\n    path: ClassVar[str]  # interpolated string for importing obj\n    _target_: ClassVar[Literal[\"hydra_zen.funcs.get_obj\"]] = \"hydra_zen.funcs.get_obj\"\n\n\nclass ZenPartialMixin(Protocol[T]):\n    _zen_target: ClassVar[str]\n    _zen_partial: ClassVar[Literal[True]] = True\n\n\nclass HydraPartialMixin(Protocol[T]):\n    _partial_: ClassVar[Literal[True]] = True\n\n\n@runtime_checkable\nclass ZenPartialBuilds(Builds[T], ZenPartialMixin[T], Protocol[T]):\n    _target_: ClassVar[\n        Literal[\"hydra_zen.funcs.zen_processing\"]\n    ] = \"hydra_zen.funcs.zen_processing\"\n\n\n@runtime_checkable\nclass HydraPartialBuilds(Builds[T], HydraPartialMixin[T], Protocol[T]):\n    ...\n\n\n# Necessary, but not sufficient, check for PartialBuilds; useful for creating\n# non-overlapping overloads\nIsPartial: TypeAlias = Union[ZenPartialMixin[T], HydraPartialMixin[T]]\n\nPartialBuilds: TypeAlias = Union[ZenPartialBuilds[T], HydraPartialBuilds[T]]\n\n\n@runtime_checkable\nclass HasTarget(Protocol):\n    _target_: str\n\n\nImportable = TypeVar(\"Importable\", bound=Callable[..., Any])\n\n_HydraPrimitive: TypeAlias = Union[\n    bool, None, int, float, str, ByteString, Path, WindowsPath, PosixPath\n]\n\n_SupportedViaBuilds = Union[\n    Partial[Any],\n    range,\n    Set[Any],\n]\n\n_SupportedPrimitive: TypeAlias = Union[\n    _HydraPrimitive,\n    ListConfig,\n    DictConfig,\n    Callable[..., Any],\n    Enum,\n    DataClass_,\n    complex,\n    _SupportedViaBuilds,\n    EmptyDict,  # not covered by Mapping[..., ...]]\n]\n\nif TYPE_CHECKING:\n    SupportedPrimitive: TypeAlias = Union[\n        _SupportedPrimitive,\n        FrozenSet[\"SupportedPrimitive\"],\n        # Even thought this is redundant with Sequence, it seems to\n        # be needed for pyright to do proper checking of tuple contents\n        Tuple[\"SupportedPrimitive\", ...],\n        # Mutable generic containers need to be invariant, so\n        # we have to settle for Sequence/Mapping. While this\n        # is overly permissive in terms of sequence-type, it\n        # at least affords quality checking of sequence content\n        Sequence[\"SupportedPrimitive\"],\n        # Mapping is covariant only in value\n        Mapping[Any, \"SupportedPrimitive\"],\n    ]\nelse:\n    # cleans up annotations for REPLs\n    SupportedPrimitive = TypeVar(\"SupportedPrimitive\")\n\n\nZenWrapper: TypeAlias = Union[\n    None,\n    Builds[Callable[[T4], T4]],\n    PartialBuilds[Callable[[T4], T4]],\n    Just[Callable[[T4], T4]],\n    Type[Builds[Callable[[T4], T4]]],\n    Type[PartialBuilds[Callable[[T4], T4]]],\n    Type[Just[Callable[[T4], T4]]],\n    Callable[[T4], T4],\n    str,\n]\nif TYPE_CHECKING:\n    ZenWrappers: TypeAlias = Union[ZenWrapper[T4], Sequence[ZenWrapper[T4]]]\nelse:\n    # cleans up annotations for REPLs\n    class ZenWrappers(Generic[T2]):  # pragma: no cover\n        pass\n\n\nDefaultsList = List[\n    Union[str, DataClass_, Mapping[str, Union[None, str, Sequence[str]]]]\n]\n\n\n# Lists all zen-convert settings and their types. Not part of public API\nclass AllConvert(TypedDict, total=True):\n    dataclass: bool\n\n\n# used for runtime type-checking\nconvert_types: Final = {\"dataclass\": bool}\n\nGroupName: TypeAlias = Optional[str]\nNodeName: TypeAlias = str\nNode: TypeAlias = Any\n\n\n# TODO: make immutable\nclass StoreEntry(TypedDict):\n    name: NodeName\n    group: GroupName\n    package: Optional[str]\n    provider: Optional[str]\n    node: Node\n\n\nclass ZenConvert(TypedDict, total=False):\n    \"\"\"A TypedDict that provides a type-checked interface for specifying zen-convert\n    options that configure the hydra-zen config-creation functions (e.g., `builds`,\n    `just`, and `make_config`).\n\n    Note that, at runtime, `ZenConvert` is simply a dictionary with type-annotations. There is no enforced runtime validation of its keys and values.\n\n    Parameters\n    ----------\n    dataclass : bool\n        If `True` any dataclass type/instance without a `_target_` field is\n        automatically converted to a targeted config that will instantiate to that type/\n        instance. Otherwise the dataclass type/instance will be passed through as-is.\n\n        Note that this only works with statically-defined dataclass types, whereas\n        :func:`~hydra_zen.make_config` and :py:func:`dataclasses.make_dataclass`\n        dynamically generate dataclass types. Additionally, this feature is not\n        compatible with a dataclass instance whose type possesses an `InitVar` field.\n\n    Examples\n    --------\n    >>> from hydra_zen.typing import ZenConvert as zc\n    >>> zc()\n    {}\n    >>> zc(dataclass=True)\n    {\"dataclass\": True}\n    >>> # static type-checker will raise, but runtime will not\n    >>> zc(apple=1)  # type: ignore\n    {\"apple\": 1}\n\n    **Configuring dataclass auto-config behaviors**\n\n    >>> from hydra_zen import instantiate as I\n    >>> from hydra_zen import builds, just\n    >>> from dataclasses import dataclass\n    >>> @dataclass\n    ... class B:\n    ...     x: int\n    >>> b = B(x=1)\n\n    >>> I(just(b))\n    B(x=1)\n    >>> I(just(b, zen_convert=zc(dataclass=False)))  # returns omegaconf.DictConfig\n    {\"x\": 1}\n\n    >>> I(builds(dict, y=b))\n    {'y': B(x=1)}\n    >>> I(builds(dict, y=b, zen_convert=zc(dataclass=False)))  # returns omegaconf.DictConfig\n    {'y': {'x': 1}}\n\n    >>> I(make_config(y=b))  # returns omegaconf.DictConfig\n    {'y': {'x': 1}}\n    >>> I(make_config(y=b, zen_convert=zc(dataclass=True), hydra_convert=\"all\"))\n    {'y': B(x=1)}\n\n    Auto-config support does not work with dynamically-generated dataclass types\n\n    >>> just(make_config(z=1))\n    HydraZenUnsupportedPrimitiveError: ...\n    >>> I(just(make_config(z=1), zen_convert=zc(dataclass=False)))\n    {'z': 1}\n\n    A dataclass with a `_target_` field will not be converted:\n\n    >>> @dataclass\n    ... class BuildsStr:\n    ...     _target_: str = 'builtins.str'\n    ...\n    >>> BuildsStr is just(BuildsStr)\n    True\n    >>> (builds_str := BuildsStr()) is just(builds_str)\n    True\n    \"\"\"\n\n    dataclass: bool\n", "path": "src/hydra_zen/typing/_implementations.py"}]}