Skip to content

bpo-29957: change LBYL key lookup to dict.setdefault #938

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions Lib/lib2to3/btm_matcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,7 @@ def run(self, leaves):
#token matches
current_ac_node = current_ac_node.transition_table[node_token]
for fixer in current_ac_node.fixers:
if not fixer in results:
results[fixer] = []
results[fixer].append(current_ast_node)

else:
#matching failed, reset automaton
current_ac_node = self.root
Expand All @@ -134,8 +131,6 @@ def run(self, leaves):
#token matches
current_ac_node = current_ac_node.transition_table[node_token]
for fixer in current_ac_node.fixers:
if not fixer in results.keys():
results[fixer] = []
results[fixer].append(current_ast_node)

current_ast_node = current_ast_node.parent
Expand Down
1 change: 1 addition & 0 deletions Misc/ACKS
Original file line number Diff line number Diff line change
Expand Up @@ -1376,6 +1376,7 @@ Steven Scott
Nick Seidenman
Michael Seifert
Žiga Seilnacht
Michael Selik
Yury Selivanov
Fred Sells
Jiwon Seo
Expand Down