diff options
author | Marvin Scholz <epirat07@gmail.com> | 2025-04-01 22:11:14 +0200 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2025-08-29 17:36:44 -0400 |
commit | 17aa0acd0b91df8c38fb3be948b5d32ff73fd91d (patch) | |
tree | 7134ae0217638340e889d7a8b3695ddee2578e3a /docs/markdown | |
parent | 36a47e91619fc47312ebcbf7b4832207ae46e017 (diff) | |
download | meson-17aa0acd0b91df8c38fb3be948b5d32ff73fd91d.zip meson-17aa0acd0b91df8c38fb3be948b5d32ff73fd91d.tar.gz meson-17aa0acd0b91df8c38fb3be948b5d32ff73fd91d.tar.bz2 |
interpreter: add dict.values() method
Analogous to keys(), this returns the values in an array. It uses the
same sorting as keys(), else it would quite confusing to return values
in a different order than the corresponding keys.
Diffstat (limited to 'docs/markdown')
-rw-r--r-- | docs/markdown/snippets/add_dict_values.md | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/markdown/snippets/add_dict_values.md b/docs/markdown/snippets/add_dict_values.md new file mode 100644 index 0000000..0b97a70 --- /dev/null +++ b/docs/markdown/snippets/add_dict_values.md @@ -0,0 +1,12 @@ +## Added a `values()` method for dictionaries + +Mesons built-in [[@dict]] type now supports the [[dict.values]] method +to retrieve the dictionary values as an array, analogous to the +[[dict.keys]] method. + +```meson +dict = { 'b': 'world', 'a': 'hello' } + +[[#dict.keys]] # Returns ['a', 'b'] +[[#dict.values]] # Returns ['hello', 'world'] +``` |