summaryrefslogtreecommitdiff
path: root/docs/reference.rst
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2019-08-18 17:41:33 +0200
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2019-08-24 15:13:09 +0200
commita5cc0fb509b2c515ae73c85f9a4d426a3f9100e3 (patch)
tree2beb1ad109f28f995b293a548da4ef76818b7bc3 /docs/reference.rst
parentfdef1e9cdae901d095d8e8c9cd6fa6adcfe02074 (diff)
downloadsemantic-version-a5cc0fb509b2c515ae73c85f9a4d426a3f9100e3.tar.gz
Allow Version(major=1, ...).
Eases the creation of version objects from existing versions. We still validate the type and structure of each component.
Diffstat (limited to 'docs/reference.rst')
-rw-r--r--docs/reference.rst10
1 files changed, 10 insertions, 0 deletions
diff --git a/docs/reference.rst b/docs/reference.rst
index 7c91200..58aa320 100644
--- a/docs/reference.rst
+++ b/docs/reference.rst
@@ -76,6 +76,16 @@ Representing a version (the Version class)
>>> str(Version('1.1.1'))
'1.1.1'
+.. class:: Version(major: int, minor: int, patch: int, prereleases: tuple, build: tuple[, partial=False])
+
+ Constructed from named components:
+
+ .. code-block:: pycon
+
+ >>> Version(major=1, minor=2, patch=3)
+ Version('1.2.3')
+
+
.. rubric:: Attributes