Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 38acd4c

Browse files
committed
Issue 21469: Minor code modernization (convert and/or expression to an if/else expression).
Suggested by: Tal Einat
1 parent 51669d8 commit 38acd4c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/urllib/robotparser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def applies_to(self, filename):
172172
return self.path == "*" or filename.startswith(self.path)
173173

174174
def __str__(self):
175-
return (self.allowance and "Allow" or "Disallow") + ": " + self.path
175+
return ("Allow" if self.allowance else "Disallow") + ": " + self.path
176176

177177

178178
class Entry:

0 commit comments

Comments
 (0)