Skip to content

Commit

Permalink
fix union syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
sigma67 committed Dec 17, 2024
1 parent 347c2e6 commit b454614
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ytmusicapi/mixins/browsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -844,10 +844,14 @@ def get_lyrics(self, browseId: str, timestamps: Literal[False] = False) -> Optio
"""overload for mypy only"""

@overload
def get_lyrics(self, browseId: str, timestamps: Literal[True] = True) -> Optional[Lyrics | TimedLyrics]:
def get_lyrics(
self, browseId: str, timestamps: Literal[True] = True
) -> Optional[Union[Lyrics, TimedLyrics]]:
"""overload for mypy only"""

def get_lyrics(self, browseId: str, timestamps: Optional[bool] = False) -> Optional[Lyrics | TimedLyrics]:
def get_lyrics(
self, browseId: str, timestamps: Optional[bool] = False
) -> Optional[Union[Lyrics, TimedLyrics]]:
"""
Returns lyrics of a song or video. When `timestamps` is set, lyrics are returned with
timestamps, if available.
Expand Down

0 comments on commit b454614

Please sign in to comment.