Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f74e3a3

Browse files
mzjp2tomschr
authored andcommitted
Improve documentation for semver max/min; fix #337
1 parent 4631fa6 commit f74e3a3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/migratetosemver3.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Use Version instead of VersionInfo
2020
The :class:`VersionInfo` has been renamed to :class:`Version`
2121
to have a more succinct name.
2222
An alias has been created to preserve compatibility but
23-
using old name has been deprecated.
23+
using the old name has been deprecated.
2424

2525
If you still need the old version, use this line:
2626

@@ -39,4 +39,4 @@ import it from :mod:`semver.cli` in the future:
3939

4040
.. code-block:: python
4141
42-
from semver.cli import cmd_bump
42+
from semver.cli import cmd_bump

docs/usage.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,9 +546,9 @@ For example, here are the maximum and minimum versions of a list of version stri
546546

547547
.. code-block:: python
548548
549-
>>> str(max(map(Version.parse, ['1.1.0', '1.2.0', '2.1.0', '0.5.10', '0.4.99'])))
549+
>>> max(['1.1.0', '1.2.0', '2.1.0', '0.5.10', '0.4.99'], key=Version.parse)
550550
'2.1.0'
551-
>>> str(min(map(Version.parse, ['1.1.0', '1.2.0', '2.1.0', '0.5.10', '0.4.99'])))
551+
>>> min(['1.1.0', '1.2.0', '2.1.0', '0.5.10', '0.4.99'], key=Version.parse)
552552
'0.4.99'
553553
554554
And the same can be done with tuples:

0 commit comments

Comments
 (0)