Skip to content

Commit d6912e2

Browse files
committed
clarify the doc
1 parent ab9b139 commit d6912e2

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

python/private/config_settings.bzl

+10-8
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,17 @@ def _flag_values(python_versions):
3636
python_versions: list of strings; all X.Y.Z python versions
3737
3838
Returns:
39-
A map with config settings as keys and values as extra flag values to be included in
40-
the config_setting_group if they should be also matched, which is used for generating
41-
correct entries for matching the latest 3.8 version, etc.
39+
A map with config settings as keys and values are all of the python_version flag
40+
values that that match the given 'key' specification. For example:
41+
```
42+
"3.8" -> ["3.8", "3.8.1", "3.8.2", ..., "3.8.19"] # All 3.8 versions
43+
"3.8.2" -> ["3.8.2"] # Only 3.8.2
44+
"3.8.19" -> ["3.8.19", "3.8"] # The latest version should also match 3.8 so
45+
as when the `3.8` toolchain is used we just use the latest `3.8` toolchain.
46+
this makes the `select("is_python_3.8.19")` work no matter how the user
47+
specifies the latest python version to use.
48+
```
4249
"""
43-
44-
# Maps e.g.
45-
# "3.8" -> ["3.8", "3.8.1", "3.8.2", ..., "3.8.19"]
46-
# "3.8.2" -> ["3.8.2"] # no extra versions
47-
# "3.8.19" -> ["3.8.19", "3.8"] # The last version should also match 3.8
4850
ret = {}
4951

5052
for micro_version in sorted(python_versions, key = _ver_key):

0 commit comments

Comments
 (0)