summaryrefslogtreecommitdiff
path: root/README.rst
diff options
context:
space:
mode:
Diffstat (limited to 'README.rst')
-rw-r--r--README.rst16
1 files changed, 16 insertions, 0 deletions
diff --git a/README.rst b/README.rst
index 682a8c7..ac42f72 100644
--- a/README.rst
+++ b/README.rst
@@ -149,6 +149,22 @@ It is also possible to check whether a given string is a proper semantic version
False
+Finally, one may create a :class:`Version` with named components instead:
+
+.. code-block:: pycon
+
+ >>> semantic_version.Version(major=0, minor=1, patch=2)
+ Version('0.1.2')
+
+In that case, ``major``, ``minor`` and ``patch`` are mandatory, and must be integers.
+``prerelease`` and ``patch``, if provided, must be tuples of strings:
+
+.. code-block:: pycon
+
+ >>> semantic_version.Version(major=0, minor=1, patch=2, prerelease=('alpha', '2'))
+ Version('0.1.2-alpha.2')
+
+
Requirement specification
-------------------------