Skip to content

Commit 463f6bc

Browse files
committed
PEP 825: clarify that value lists need to be sorted
Signed-off-by: Michał Górny <mgorny@quansight.com>
1 parent 0f1645c commit 463f6bc

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

peps/pep-0825.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,8 @@ present in that wheel's filename.
245245

246246
It has 3 levels. The first level keys are variant labels, the second
247247
level keys are namespaces, the third level are feature names, and the
248-
third level values are lists of feature values.
248+
third level values are sets of feature values, converted to lists,
249+
sorted lexically.
249250

250251

251252
Example
@@ -802,6 +803,10 @@ the variant metadata is mirrored in a JSON file published on the index.
802803
This enables installers to obtain variant property mapping without
803804
having to fetch individual wheels.
804805

806+
Since JSON format does not feature a set type, sets are represented as
807+
sorted lists. Sorting ensures that tools can safely use equality
808+
comparison over dictionaries.
809+
805810
The variant ordering algorithm has been proposed with the assumption
806811
that variant properties take precedence over Platform compatibility
807812
tags, as they are primarily used to express user preferences. This
@@ -988,6 +993,11 @@ and Zanie Blue.
988993
Change History
989994
==============
990995

996+
- TO BE PUBLISHED
997+
998+
- Clarified that feature values in ``variants`` dictionary are sets,
999+
and that they ought to be sorted when serializing.
1000+
9911001
- 17-Feb-2026
9921002

9931003
- Initial version, split from :pep:`817` draft.

0 commit comments

Comments
 (0)