diff options
author | Jon Dufresne <jon.dufresne@gmail.com> | 2017-05-18 14:35:54 (GMT) |
---|---|---|
committer | Raymond Hettinger <rhettinger@users.noreply.github.com> | 2017-05-18 14:35:54 (GMT) |
commit | 3972628de3d569c88451a2a176a1c94d8822b8a6 (patch) | |
tree | 30627d132c42fb65f96c3d9e209b317f68d175ed /Lib/tokenize.py | |
parent | 906f5330b9c9a74cad1cf27fddaf77e99dff9edd (diff) | |
download | cpython-3972628de3d569c88451a2a176a1c94d8822b8a6.zip cpython-3972628de3d569c88451a2a176a1c94d8822b8a6.tar.gz cpython-3972628de3d569c88451a2a176a1c94d8822b8a6.tar.bz2 |
bpo-30296 Remove unnecessary tuples, lists, sets, and dicts (#1489)
* Replaced list(<generator expression>) with list comprehension
* Replaced dict(<generator expression>) with dict comprehension
* Replaced set(<list literal>) with set literal
* Replaced builtin func(<list comprehension>) with func(<generator
expression>) when supported (e.g. any(), all(), tuple(), min(), &
max())
Diffstat (limited to 'Lib/tokenize.py')
-rw-r--r-- | Lib/tokenize.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/tokenize.py b/Lib/tokenize.py index eea88b7..634662d 100644 --- a/Lib/tokenize.py +++ b/Lib/tokenize.py @@ -142,7 +142,7 @@ def _all_string_prefixes(): # 'rf'). The various permutations will be generated. _valid_string_prefixes = ['b', 'r', 'u', 'f', 'br', 'fr'] # if we add binary f-strings, add: ['fb', 'fbr'] - result = set(['']) + result = {''} for prefix in _valid_string_prefixes: for t in _itertools.permutations(prefix): # create a list with upper and lower versions of each |