Skip to content

Commit 98480ce

Browse files
jonathan-scholbachrhettinger
authored andcommitted
bpo-38771: Explict test for None in code example (GH-17108)
1 parent a0ed99b commit 98480ce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Doc/library/collections.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ environment variables which in turn take precedence over default values::
162162
parser.add_argument('-u', '--user')
163163
parser.add_argument('-c', '--color')
164164
namespace = parser.parse_args()
165-
command_line_args = {k:v for k, v in vars(namespace).items() if v}
165+
command_line_args = {k: v for k, v in vars(namespace).items() if v is not None}
166166

167167
combined = ChainMap(command_line_args, os.environ, defaults)
168168
print(combined['color'])

0 commit comments

Comments
 (0)