Skip to content

Commit 49d5328

Browse files
committed
fix: include ~= and === in text
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 1606c4a commit 49d5328

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

source/specifications/dependency-specifiers.rst

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,14 @@ The variables marked with ``Version`` or ``Version | String`` use the version
201201
comparison rules of the :ref:`Version specifier specification
202202
<version-specifiers>` when those are defined (that is when both sides have a
203203
valid version specifier). If either side is not expressible as a ``Version``,
204-
then ``>=``, and ``<=`` only check for exact equality; no ordering is assumed.
205-
On other operators, operators perform the same as they do for strings or sets
206-
in Python based on whether the marker value is a string or set itself.
207-
Otherwise an error should be raised. e.g. the following will result in errors::
204+
then ``>=`` and``<=``, are equivalent to ``==``; no ordering is
205+
assumed. The ``<`` and ``>`` operators always return false on strings. The
206+
``===`` legacy arbitrary equivalence operator does an exact, case insensitive
207+
comparison regardless of if a string fallback is used. On other operators,
208+
operators perform the same as they do for strings or sets in Python based on
209+
whether the marker value is a string or set itself. Otherwise an error should
210+
be raised; it should be noted that ``~=`` does not support string fallback.
211+
e.g. the following will result in errors::
208212

209213
"dog" ~= "fred"
210214
python_version ~= "surprise"
@@ -214,7 +218,8 @@ ordered comparison operators may also follow same rules as ``Version`` defined
214218
above when one side is not a valid Version, with ``>=`` and ``<=`` being
215219
equivalent to ``==``, and ``<`` and ``>`` always evaluating to ``False``. This
216220
is legacy behavior due to an older version of this spec, and tools may choose
217-
to warn or fail if ordered comparisons are used on ``String`` markers.
221+
to warn or fail if ordered comparisons are used on ``String`` markers. ``~=``
222+
and ``====`` (legacy arbitrary equivalence) are not supported on string fields.
218223

219224
User supplied constants are always encoded as strings with either ``'`` or
220225
``"`` quote marks. Note that backslash escapes are not defined, but existing

0 commit comments

Comments
 (0)