aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown/snippets
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2023-05-30 09:27:42 -0400
committerXavier Claessens <xclaesse@gmail.com>2023-08-02 13:35:29 -0400
commitcec3edc08a6cd6a89761c49292ba6a3bace8b3c1 (patch)
treeca8f4504ead8fe875ef582299b2cbb9f07d85688 /docs/markdown/snippets
parent465ad6d261e2733c60c3a066eebabee72f14346a (diff)
downloadmeson-cec3edc08a6cd6a89761c49292ba6a3bace8b3c1.zip
meson-cec3edc08a6cd6a89761c49292ba6a3bace8b3c1.tar.gz
meson-cec3edc08a6cd6a89761c49292ba6a3bace8b3c1.tar.bz2
Unify message(), format() and fstring formatting
Share a common function to convert objects to display strings for consistency. While at it, also add support for formatting user options.
Diffstat (limited to 'docs/markdown/snippets')
-rw-r--r--docs/markdown/snippets/string_format.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/docs/markdown/snippets/string_format.md b/docs/markdown/snippets/string_format.md
new file mode 100644
index 0000000..fa33617
--- /dev/null
+++ b/docs/markdown/snippets/string_format.md
@@ -0,0 +1,10 @@
+## Unified message(), str.format() and f-string formatting
+
+They now all support the same set of values: strings, integers, bools, options,
+dictionaries and lists thereof.
+
+- Feature options (i.e. enabled, disabled, auto) were not previously supported
+ by any of those functions.
+- Lists and dictionaries were not previously supported by f-string.
+- str.format() allowed any type and often resulted in printing the internal
+ representation which is now deprecated.