Skip to content

Commit

Permalink
Merge Union-Literal type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
lucc committed Jan 3, 2025
1 parent 8686e3b commit fc8791d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions khard/contacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ def multi_property_key(item: str) -> tuple[Literal[0], str]: ...
@overload
def multi_property_key(item: dict[T, Any]) -> tuple[Literal[1], T]: ...
@overload
def multi_property_key(item: Union[str, dict[T, Any]]) -> tuple[Union[Literal[0], Literal[1]], Union[str, T]]: ...
def multi_property_key(item: Union[str, dict[T, Any]]
) -> tuple[int, Union[T, str]]:
def multi_property_key(item: Union[str, dict[T, Any]]) -> tuple[Literal[0, 1], Union[T, str]]: ...
def multi_property_key(item: Union[str, dict[T, Any]]) -> tuple[Literal[0, 1], Union[T, str]]:
"""Key function to pass to sorted(), allowing sorting of dicts with lists
and strings. Dicts will be sorted by their label, after other types.
Expand Down

0 comments on commit fc8791d

Please sign in to comment.