From: Raymond Hettinger Date: Tue, 13 May 2014 05:22:46 +0000 (-0700) Subject: Issue 21469: Minor code modernization (convert and/or expression to an if/else expre... X-Git-Tag: v3.5.0a1~1666 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=38acd4c028f72a80079c27d68c8da2efd059a38d;p=python Issue 21469: Minor code modernization (convert and/or expression to an if/else expression). Suggested by: Tal Einat --- diff --git a/Lib/urllib/robotparser.py b/Lib/urllib/robotparser.py index 1d7b751e03..4fbb0cb995 100644 --- a/Lib/urllib/robotparser.py +++ b/Lib/urllib/robotparser.py @@ -172,7 +172,7 @@ class RuleLine: return self.path == "*" or filename.startswith(self.path) def __str__(self): - return (self.allowance and "Allow" or "Disallow") + ": " + self.path + return ("Allow" if self.allowance else "Disallow") + ": " + self.path class Entry: