Skip to content

Commit

Permalink
Improve docs
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-Christophe Morin <[email protected]>
  • Loading branch information
JeanChristopheMorinPerso committed Nov 24, 2023
1 parent b33b964 commit 6054d5c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/rez/version/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


"""
Implements a well defined versioning schema.
Implements everything needed to manipulate versions and requirements.
There are three class types: :class:`VersionToken`, :class:`Version` and :class:`VersionRange`.
A :class:`Version` is a set of zero or more :class:`VersionToken`\\s, separate by ``.``\\s or ``-``\\s (eg ``1.2-3``).
Expand All @@ -19,6 +19,9 @@
The empty version ``''``, and empty version range ``''``, are also handled. The empty
version is used to denote unversioned objects. The empty version range, also
known as the 'any' range, is used to refer to any version of an object.
Requirements and list of requirements are represented by :class:`Requirement` and
:class:`RequirementList` respectively.
"""

from rez.version._requirement import Requirement, RequirementList, VersionedObject
Expand Down
5 changes: 2 additions & 3 deletions src/rez/version/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -1158,15 +1158,14 @@ def iter_intersect_test(self, iterable, key=None, descending=False):
Args:
iterable: An ordered sequence of versioned objects. If the list
is not sorted by version, behaviour is undefined.
key (callable): Function that returns a :class:`Version` given an object
key (typing.Callable[typing.Any]): Function that returns a :class:`Version` given an object
from ``iterable``. If None, the identity function is used.
descending (bool): Set to True if ``iterable`` is in descending
version order.
Returns:
~collections.abc.Iterator[tuple[bool, typing.Any]]: An iterator that returns (bool, object) tuples,
where 'object' is
the original object in ``iterable``, and the bool indicates whether
where 'object' is the original object in ``iterable``, and the bool indicates whether
that version is contained in this range.
"""
return _ContainsVersionIterator(self, iterable, key, descending)
Expand Down

0 comments on commit 6054d5c

Please sign in to comment.