From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 12 Nov 2019 00:59:14 +0000 (-0800) Subject: bpo-38771: Explict test for None in code example (GH-17108) (GH-17109) X-Git-Tag: v3.8.1rc1~98 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d8e08456025d9349abbf76035c821d3f7b2d722a;p=thirdparty%2FPython%2Fcpython.git bpo-38771: Explict test for None in code example (GH-17108) (GH-17109) (cherry picked from commit 98480cef9dba04794bd61c7e7cca643d384c8c35) Co-authored-by: Jonathan Scholbach --- diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index 90a3f4bea9a4..a5e8d04099b2 100644 --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -162,7 +162,7 @@ environment variables which in turn take precedence over default values:: parser.add_argument('-u', '--user') parser.add_argument('-c', '--color') namespace = parser.parse_args() - command_line_args = {k:v for k, v in vars(namespace).items() if v} + command_line_args = {k: v for k, v in vars(namespace).items() if v is not None} combined = ChainMap(command_line_args, os.environ, defaults) print(combined['color'])