Skip to content

Commit c0b47fd

Browse files
committed
Annotate existing bytes support in Version.is_valid
1 parent 84561d5 commit c0b47fd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/semver/version.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ def replace(self, **parts: Union[int, Optional[str]]) -> "Version":
789789
raise TypeError(error)
790790

791791
@classmethod
792-
def is_valid(cls, version: str) -> bool:
792+
def is_valid(cls, version: String) -> bool:
793793
"""
794794
Check if the string is a valid semver version.
795795
@@ -798,7 +798,7 @@ def is_valid(cls, version: str) -> bool:
798798
.. versionchanged:: 3.0.0
799799
Renamed from :meth:`~semver.version.Version.isvalid`
800800
801-
:param version: the version string to check
801+
:param version: the version string to check, as str or UTF-8 encoded bytes
802802
:return: True if the version string is a valid semver version, False
803803
otherwise.
804804
"""

0 commit comments

Comments
 (0)