summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-11-12 00:59:14 (GMT)
committerRaymond Hettinger <rhettinger@users.noreply.github.com>2019-11-12 00:59:14 (GMT)
commitd8e08456025d9349abbf76035c821d3f7b2d722a (patch)
treef9269b7b2f409aaa9b342f7fe64edc5353cb97ad
parent85e415108226cc5f3fdddd70196fc4c2a1d0f7f4 (diff)
downloadcpython-d8e08456025d9349abbf76035c821d3f7b2d722a.zip
cpython-d8e08456025d9349abbf76035c821d3f7b2d722a.tar.gz
cpython-d8e08456025d9349abbf76035c821d3f7b2d722a.tar.bz2
bpo-38771: Explict test for None in code example (GH-17108) (GH-17109)
(cherry picked from commit 98480cef9dba04794bd61c7e7cca643d384c8c35) Co-authored-by: Jonathan Scholbach <j.scholbach@posteo.de>
-rw-r--r--Doc/library/collections.rst2
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'])