Skip to content

Commit cfcbec7

Browse files
committed
Make docstrings consistent
* Use VersionInfo instead of semver.VersionInfo * Change order. Deprecation notice should come first in docstring
1 parent 1f0d49b commit cfcbec7

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

semver.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -644,9 +644,9 @@ def parse(version):
644644
Parse version string to a VersionInfo instance.
645645
646646
:param version: version string
647-
:return: a :class:`semver.VersionInfo` instance
647+
:return: a :class:`VersionInfo` instance
648648
:raises: :class:`ValueError`
649-
:rtype: :class:`semver.VersionInfo`
649+
:rtype: :class:`VersionInfo`
650650
651651
>>> semver.VersionInfo.parse('3.4.5-pre.2+build.4')
652652
VersionInfo(major=3, minor=4, patch=5, \
@@ -667,14 +667,14 @@ def parse(version):
667667
def replace(self, **parts):
668668
"""
669669
Replace one or more parts of a version and return a new
670-
:class:`semver.VersionInfo` object, but leave self untouched
670+
:class:`VersionInfo` object, but leave self untouched
671671
672672
.. versionadded:: 2.9.0
673673
Added :func:`VersionInfo.replace`
674674
675675
:param dict parts: the parts to be updated. Valid keys are:
676676
``major``, ``minor``, ``patch``, ``prerelease``, or ``build``
677-
:return: the new :class:`semver.VersionInfo` object with the changed
677+
:return: the new :class:`VersionInfo` object with the changed
678678
parts
679679
:raises: :class:`TypeError`, if ``parts`` contains invalid keys
680680
"""
@@ -975,12 +975,12 @@ def finalize_version(version):
975975
"""
976976
Remove any prerelease and build metadata from the version string.
977977
978-
.. versionadded:: 2.7.9
979-
Added :func:`finalize_version`
980-
981978
.. deprecated:: 2.10.0
982979
Use :func:`semver.VersionInfo.finalize_version` instead.
983980
981+
.. versionadded:: 2.7.9
982+
Added :func:`finalize_version`
983+
984984
:param version: version string
985985
:return: the finalized version string
986986
:rtype: str
@@ -997,12 +997,12 @@ def replace(version, **parts):
997997
"""
998998
Replace one or more parts of a version and return the new string.
999999
1000-
.. versionadded:: 2.9.0
1001-
Added :func:`replace`
1002-
10031000
.. deprecated:: 2.10.0
10041001
Use :func:`semver.VersionInfo.replace` instead.
10051002
1003+
.. versionadded:: 2.9.0
1004+
Added :func:`replace`
1005+
10061006
:param str version: the version string to replace
10071007
:param dict parts: the parts to be updated. Valid keys are:
10081008
``major``, ``minor``, ``patch``, ``prerelease``, or ``build``

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy