diff options
author | Jonathan Scholbach <j.scholbach@posteo.de> | 2019-11-12 00:49:41 (GMT) |
---|---|---|
committer | Raymond Hettinger <rhettinger@users.noreply.github.com> | 2019-11-12 00:49:41 (GMT) |
commit | 98480cef9dba04794bd61c7e7cca643d384c8c35 (patch) | |
tree | f3e81bcdf11d8be9648ea81c1c628eb911b7d44c /Doc/library/collections.rst | |
parent | a0ed99bca8475cbc82e9202aa354faba2a4620f4 (diff) | |
download | cpython-98480cef9dba04794bd61c7e7cca643d384c8c35.zip cpython-98480cef9dba04794bd61c7e7cca643d384c8c35.tar.gz cpython-98480cef9dba04794bd61c7e7cca643d384c8c35.tar.bz2 |
bpo-38771: Explict test for None in code example (GH-17108)
Diffstat (limited to 'Doc/library/collections.rst')
-rw-r--r-- | Doc/library/collections.rst | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index 90a3f4b..a5e8d04 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']) |