Skip to content

Commit

Permalink
bpo-38771: Explict test for None in code example (GH-17108)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-scholbach authored and rhettinger committed Nov 12, 2019
1 parent a0ed99b commit 98480ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Doc/library/collections.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand Down

0 comments on commit 98480ce

Please sign in to comment.