From: Karthikeyan Singaravelan Date: Fri, 1 May 2020 04:38:30 +0000 (+0000) Subject: Add specific check for zero and False since False == 0 is True. X-Git-Url: https://git.devinivas.org/?a=commitdiff_plain;h=10fb9ced692c3770e9522e0959cd4eed335caeea;p=chevron.git Add specific check for zero and False since False == 0 is True. --- diff --git a/chevron/renderer.py b/chevron/renderer.py index 58817ef..ce21f51 100644 --- a/chevron/renderer.py +++ b/chevron/renderer.py @@ -74,10 +74,8 @@ def _get_key(key, scopes): # Return an empty string if falsy, with two exceptions # 0 should return 0, and False should return False - if scope == 0: - return 0 - if scope is False: - return False + if scope in (0, False): + return scope try: # This allows for custom falsy data types