|
36 | 36 | overload, |
37 | 37 | ) |
38 | 38 |
|
39 | | -from typing_extensions import Literal, Protocol, TypeGuard, get_args, get_origin |
| 39 | +from typing_extensions import Literal, Protocol, TypeGuard, deprecated, get_args, get_origin |
40 | 40 |
|
41 | 41 | # There are cases where typing.Literal doesn't match typing_extensions.Literal: |
42 | 42 | # https://github.com/python/typing_extensions/pull/148 |
@@ -115,6 +115,7 @@ def __init__(self, *args, **kwargs): |
115 | 115 | super().__init__(*args, **kwargs) |
116 | 116 |
|
117 | 117 |
|
| 118 | +@deprecated("This is unused internally and will be removed soon.") |
118 | 119 | def camel_case(name): |
119 | 120 | s1 = re.sub("(.)([A-Z][a-z]+)", r"\1_\2", name) |
120 | 121 | return re.sub("([a-z0-9])([A-Z])", r"\1_\2", s1).lower() |
@@ -614,6 +615,7 @@ def get_container_nargs(container_type: type) -> int | str: |
614 | 615 | raise NotImplementedError(f"Not sure what 'nargs' should be for type {container_type}") |
615 | 616 |
|
616 | 617 |
|
| 618 | +@deprecated("This is likely going to be removed soon.") |
617 | 619 | def _parse_multiple_containers( |
618 | 620 | container_type: type, append_action: bool = False |
619 | 621 | ) -> Callable[[str], list[Any]]: |
@@ -888,6 +890,7 @@ def dict_union(*dicts: dict[K, V], recurse: bool = True, dict_factory=dict) -> d |
888 | 890 | return result |
889 | 891 |
|
890 | 892 |
|
| 893 | +@deprecated("This is buggy and unused internally and will be removed soon.") |
891 | 894 | def flatten(nested: PossiblyNestedMapping[K, V]) -> dict[tuple[K, ...], V]: |
892 | 895 | """Flatten a dictionary of dictionaries. The returned dictionary's keys are tuples, one entry |
893 | 896 | per layer. |
@@ -954,16 +957,19 @@ def unflatten_split( |
954 | 957 | return unflatten({tuple(key.split(sep)): value for key, value in flattened.items()}) |
955 | 958 |
|
956 | 959 |
|
| 960 | +@deprecated("This is unused internally and will be removed soon.") |
957 | 961 | @overload |
958 | 962 | def getitem_recursive(d: PossiblyNestedDict[K, V], keys: Iterable[K]) -> V: |
959 | 963 | ... |
960 | 964 |
|
961 | 965 |
|
| 966 | +@deprecated("This is unused internally and will be removed soon.") |
962 | 967 | @overload |
963 | 968 | def getitem_recursive(d: PossiblyNestedDict[K, V], keys: Iterable[K], default: T) -> V | T: |
964 | 969 | ... |
965 | 970 |
|
966 | 971 |
|
| 972 | +@deprecated("This is unused internally and will be removed soon.") |
967 | 973 | def getitem_recursive( |
968 | 974 | d: PossiblyNestedDict[K, V], keys: Iterable[K], default: T | _MISSING_TYPE = MISSING |
969 | 975 | ) -> V | T: |
|
0 commit comments