From e3703f0e1e05e6dcd7f5595c3a93748b7d847b57 Mon Sep 17 00:00:00 2001 From: Marc Bonnici Date: Mon, 11 Jan 2021 14:41:16 +0000 Subject: [PATCH] utils/doc: Fix display of Falsey default parameters Explicitly check for is `None` to determine if a default value is not present or just a Falsey value. --- wa/utils/doc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wa/utils/doc.py b/wa/utils/doc.py index b9b0fb4e..7cf94dc1 100644 --- a/wa/utils/doc.py +++ b/wa/utils/doc.py @@ -285,7 +285,7 @@ def get_params_rst(parameters): text += indent('\nallowed values: {}\n'.format(', '.join(map(format_literal, param.allowed_values)))) elif param.constraint: text += indent('\nconstraint: ``{}``\n'.format(get_type_name(param.constraint))) - if param.default: + if param.default is not None: value = param.default if isinstance(value, str) and value.startswith(USER_HOME): value = value.replace(USER_HOME, '~')